Skip to content

Commit 766b382

Browse files
authored
Merge pull request #12 from noahblon/master
Updated visually hidden class to account for deprecated clip path and…
2 parents e68788f + 7fbce40 commit 766b382

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

standards/accessibility.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ If the project requirements allow, you may combine the use of landmark ARIA role
120120

121121
In order for keyboard users to easily skip to the main content of a site without tabbing through all the previous content, use a "skip to content" link. It is also acceptable to include a "skip to navigation" link if it takes an excessive number of tabs to get focus on the navigation.
122122

123-
It's a best practice to bring skip links into view when they are focused (if they start hidden from view), however since this would then become a visual design element, it should be approved by the designer.
123+
It's best practice to bring focusable into view when they are focused.
124124

125125
```html
126126
<body>
@@ -135,15 +135,17 @@ It's a best practice to bring skip links into view when they are focused (if the
135135
```
136136

137137
```css
138-
.isVisuallyHidden {
139-
width: 1px;
140-
height: 1px;
141-
margin: -1px;
142-
padding: 0;
143-
border: 0;
144-
position: absolute;
145-
clip: rect(0 0 0 0);
146-
overflow: hidden;
138+
.isVisuallyHidden:not(:focus):not(:active) {
139+
width: 1px !important;
140+
height: 1px !important;
141+
margin: -1px !important;
142+
border: 0 !important;
143+
padding: 0 !important;
144+
clip-path: inset(100%) !important;
145+
clip: rect(0 0 0 0) !important;
146+
overflow: hidden !important;
147+
position: absolute !important;
148+
white-space: nowrap !important;
147149
}
148150
```
149151

standards/scss.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,16 @@ Provide default arguments when their absence could cause a compilation error, ot
291291

292292
```scss
293293
@mixin isVisuallyHidden() {
294-
width: 1px;
295-
height: 1px;
296-
margin: -1px;
297-
padding: 0;
298-
border: 0;
299-
position: absolute;
300-
clip: rect(0 0 0 0);
301-
overflow: hidden;
294+
width: 1px !important;
295+
height: 1px !important;
296+
margin: -1px !important;
297+
border: 0 !important;
298+
padding: 0 !important;
299+
clip-path: inset(100%) !important;
300+
clip: rect(0 0 0 0) !important;
301+
overflow: hidden !important;
302+
position: absolute !important;
303+
white-space: nowrap !important;
302304
}
303305
```
304306

0 commit comments

Comments
 (0)