|
3 | 3 | .component { position: relative; }
|
4 | 4 | .block { position: relative; }
|
5 | 5 |
|
6 |
| -// jquery.a11y start |
7 |
| -// Invisible aria-labels |
8 |
| -// -------------------------------------------------- |
9 |
| -.aria-label { |
10 |
| - position: absolute !important; |
11 |
| - &.relative { |
12 |
| - position: relative !important; |
13 |
| - } |
14 |
| - left: 0 !important; |
15 |
| - width: auto !important; |
16 |
| - height: auto !important; |
17 |
| - overflow: auto !important; |
18 |
| - color: rgba(0,0,0,0) !important; |
19 |
| - background: rgba(0,0,0,0) !important; |
20 |
| - font-size: 1px !important; |
21 |
| - padding: 0 !important; |
22 |
| - margin: 0 !important; |
23 |
| - line-height: normal !important; |
24 |
| - z-index: 1; |
| 6 | +// Use to hide content visually while keeping it accessible to assistive technologies |
| 7 | +.visually-hidden { |
| 8 | + display: block; |
| 9 | + position: absolute !important; |
| 10 | + width: 1px !important; |
| 11 | + height: 1px !important; |
| 12 | + padding: 0 !important; |
| 13 | + margin: -1px !important; |
| 14 | + overflow: hidden !important; |
| 15 | + clip: rect(0, 0, 0, 0) !important; |
| 16 | + white-space: nowrap !important; |
| 17 | + border: 0 !important; |
25 | 18 | }
|
26 | 19 |
|
27 |
| -// Force aria-labels to hide on hidden |
28 |
| -// -------------------------------------------------- |
29 |
| -.aria-label.aria-hidden { |
30 |
| - display: none !important; |
31 |
| -} |
| 20 | +.aria-label { |
| 21 | + .visually-hidden(); |
| 22 | + pointer-events: none; |
| 23 | +} |
| 24 | + |
| 25 | +// Use to only display content when it's focused |
| 26 | +.aria-label-focusable, .visually-hidden-focusable { |
| 27 | + &:not(:focus):not(:focus-within) { |
| 28 | + .visually-hidden; |
| 29 | + } |
| 30 | + } |
| 31 | + |
| 32 | +// jquery.a11y start |
32 | 33 |
|
33 | 34 | // Hidden focus guard
|
34 | 35 | // --------------------------------------------------
|
|
0 commit comments