2019-05-20 04:03:51 -04:00
|
|
|
// stylelint-disable declaration-no-important
|
|
|
|
|
2020-07-31 05:27:36 -04:00
|
|
|
// Hide content visually while keeping it accessible to assistive technologies
|
2015-03-30 20:36:00 -04:00
|
|
|
//
|
2020-09-17 13:01:04 -04:00
|
|
|
// See: https://www.a11yproject.com/posts/2013-01-11-how-to-hide-content/
|
2021-09-09 07:42:45 -04:00
|
|
|
// See: https://kittygiraudel.com/2016/10/13/css-hide-and-seek/
|
2015-03-30 20:36:00 -04:00
|
|
|
|
2020-07-31 05:27:36 -04:00
|
|
|
@mixin visually-hidden() {
|
2019-05-20 04:03:51 -04:00
|
|
|
position: absolute !important;
|
|
|
|
width: 1px !important;
|
|
|
|
height: 1px !important;
|
|
|
|
padding: 0 !important;
|
|
|
|
margin: -1px !important; // Fix for https://github.com/twbs/bootstrap/issues/25686
|
|
|
|
overflow: hidden !important;
|
|
|
|
clip: rect(0, 0, 0, 0) !important;
|
|
|
|
white-space: nowrap !important;
|
|
|
|
border: 0 !important;
|
2015-03-30 20:36:00 -04:00
|
|
|
}
|
|
|
|
|
2020-12-11 16:28:45 -05:00
|
|
|
// Use to only display content when it's focused, or one of its child elements is focused
|
|
|
|
// (i.e. when focus is within the element/container that the class was applied to)
|
2015-03-30 20:36:00 -04:00
|
|
|
//
|
2016-10-03 12:55:59 -04:00
|
|
|
// Useful for "Skip to main content" links; see https://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
|
2015-03-30 20:36:00 -04:00
|
|
|
|
2020-07-31 05:27:36 -04:00
|
|
|
@mixin visually-hidden-focusable() {
|
2020-12-11 16:28:45 -05:00
|
|
|
&:not(:focus):not(:focus-within) {
|
2020-07-03 07:38:11 -04:00
|
|
|
@include visually-hidden();
|
2015-03-30 20:36:00 -04:00
|
|
|
}
|
|
|
|
}
|