mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-18 10:52:19 +01:00
Fixes #13583: Move .sr-only and .sr-only-focusable to mixins, then use them to create classes in _utilities.scss
This commit is contained in:
parent
c82cae9a48
commit
608be81a43
@ -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 {
|
|||||||
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;
|
||||||
|
2
dist/css/bootstrap.css.map
vendored
2
dist/css/bootstrap.css.map
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap.min.css
vendored
2
dist/css/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
2
docs/assets/css/docs.min.css
vendored
2
docs/assets/css/docs.min.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 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 @@
|
|||||||
@include pull-left();
|
@include pull-left();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sr-only {
|
||||||
|
@include sr-only();
|
||||||
|
}
|
||||||
|
|
||||||
|
.sr-only-focusable {
|
||||||
|
@include sr-only-focusable();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Inverse
|
// Inverse
|
||||||
.inverse {
|
.inverse {
|
||||||
|
32
scss/mixins/_screen-reader.scss
Normal file
32
scss/mixins/_screen-reader.scss
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
// 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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user