Commit 608be81a authored by Mark Otto's avatar Mark Otto

Fixes #13583: Move .sr-only and .sr-only-focusable to mixins, then use them to...

Fixes #13583: Move .sr-only and .sr-only-focusable to mixins, then use them to create classes in _utilities.scss
parent c82cae9a
...@@ -347,26 +347,6 @@ hr { ...@@ -347,26 +347,6 @@ hr {
border-top: .0625rem solid #eceeef; border-top: .0625rem solid #eceeef;
} }
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
.sr-only-focusable:active, .sr-only-focusable:focus {
position: static;
width: auto;
height: auto;
margin: 0;
overflow: visible;
clip: auto;
}
[role="button"] { [role="button"] {
cursor: pointer; cursor: pointer;
} }
...@@ -5033,6 +5013,26 @@ button.close { ...@@ -5033,6 +5013,26 @@ button.close {
float: left !important; float: left !important;
} }
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
.sr-only-focusable:active, .sr-only-focusable:focus {
position: static;
width: auto;
height: auto;
margin: 0;
overflow: visible;
clip: auto;
}
.inverse { .inverse {
color: #eceeef; color: #eceeef;
background-color: #373a3c; background-color: #373a3c;
......
This diff was suppressed by a .gitattributes entry.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
@import "mixins/reset-filter"; @import "mixins/reset-filter";
@import "mixins/resize"; @import "mixins/resize";
@import "mixins/responsive-visibility"; @import "mixins/responsive-visibility";
@import "mixins/screen-reader";
@import "mixins/size"; @import "mixins/size";
@import "mixins/tab-focus"; @import "mixins/tab-focus";
@import "mixins/text-emphasis"; @import "mixins/text-emphasis";
......
...@@ -128,37 +128,6 @@ hr { ...@@ -128,37 +128,6 @@ hr {
} }
// Only display content to screen readers
//
// See: http://a11yproject.com/posts/how-to-hide-content/
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0,0,0,0);
border: 0;
}
// Use in conjunction with .sr-only to only display content when it's focused.
// Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
// Credit: HTML5 Boilerplate
.sr-only-focusable {
&:active,
&:focus {
position: static;
width: auto;
height: auto;
margin: 0;
overflow: visible;
clip: auto;
}
}
// iOS "clickable elements" fix for role="button" // iOS "clickable elements" fix for role="button"
// //
// Fixes "clickability" issue (and more generally, the firing of events such as focus as well) // Fixes "clickability" issue (and more generally, the firing of events such as focus as well)
......
...@@ -18,6 +18,14 @@ ...@@ -18,6 +18,14 @@
@include pull-left(); @include pull-left();
} }
.sr-only {
@include sr-only();
}
.sr-only-focusable {
@include sr-only-focusable();
}
// Inverse // Inverse
.inverse { .inverse {
......
// Only display content to screen readers
//
// See: http://a11yproject.com/posts/how-to-hide-content/
@mixin sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0,0,0,0);
border: 0;
}
// Use in conjunction with .sr-only to only display content when it's focused.
//
// Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
//
// Credit: HTML5 Boilerplate
@mixin sr-only-focusable {
&:active,
&:focus {
position: static;
width: auto;
height: auto;
margin: 0;
overflow: visible;
clip: auto;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment