Skip to content

Commit 2f7a7f5

Browse files
MartijnCuppensJakobud
authored andcommitted
Add !important to sr-only mixin to make sure nothing gets overridden.
Co-authored-by: Jake Wilson <[email protected]>
1 parent 7351d21 commit 2f7a7f5

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

scss/mixins/_screen-reader.scss

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1+
// stylelint-disable declaration-no-important
2+
13
// Only display content to screen readers
24
//
35
// See: https://a11yproject.com/posts/how-to-hide-content/
46
// See: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/
57

68
@mixin sr-only {
7-
position: absolute;
8-
width: 1px;
9-
height: 1px;
10-
padding: 0;
9+
position: absolute !important;
10+
width: 1px !important;
11+
height: 1px !important;
12+
padding: 0 !important;
1113
margin: -1px; // Fix for https://github.com/twbs/bootstrap/issues/25686
12-
overflow: hidden;
13-
clip: rect(0, 0, 0, 0);
14-
white-space: nowrap;
15-
border: 0;
14+
overflow: hidden !important;
15+
clip: rect(0, 0, 0, 0) !important;
16+
white-space: nowrap !important;
17+
border: 0 !important;
1618
}
1719

1820
// Use to only display content when it's focused.

0 commit comments

Comments
 (0)