2019-05-20 10:03:51 +02:00
|
|
|
// stylelint-disable declaration-no-important
|
|
|
|
|
2020-07-31 11:27:36 +02:00
|
|
|
// Hide content visually while keeping it accessible to assistive technologies
|
2015-03-31 02:36:00 +02:00
|
|
|
//
|
2020-09-17 19:01:04 +02:00
|
|
|
// See: https://www.a11yproject.com/posts/2013-01-11-how-to-hide-content/
|
2021-09-09 13:42:45 +02:00
|
|
|
// See: https://kittygiraudel.com/2016/10/13/css-hide-and-seek/
|
2015-03-31 02:36:00 +02:00
|
|
|
|
2020-07-31 11:27:36 +02:00
|
|
|
@mixin visually-hidden() {
|
2019-05-20 10:03:51 +02: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-31 02:36:00 +02:00
|
|
|
}
|
|
|
|
|
2020-12-11 22:28:45 +01: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-31 02:36:00 +02:00
|
|
|
//
|
2016-10-03 18:55:59 +02:00
|
|
|
// Useful for "Skip to main content" links; see https://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
|
2015-03-31 02:36:00 +02:00
|
|
|
|
2020-07-31 11:27:36 +02:00
|
|
|
@mixin visually-hidden-focusable() {
|
2020-12-11 22:28:45 +01:00
|
|
|
&:not(:focus):not(:focus-within) {
|
2020-07-03 13:38:11 +02:00
|
|
|
@include visually-hidden();
|
2015-03-31 02:36:00 +02:00
|
|
|
}
|
|
|
|
}
|