Skip to content

Commit a8385ea

Browse files
docs: migrate a11y-semantics.md CodePens to the Vue account (#983)
1 parent 88c61cb commit a8385ea

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/guide/a11y-semantics.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Labels are typically placed on top or to the left of the form fields:
2121
</form>
2222
```
2323

24-
<common-codepen-snippet title="Simple Form" slug="YzwpPYZ" :height="368" tab="js,result" :team="false" user="mlama007" name="Maria" theme="light" :preview="false" :editable="false" />
24+
<common-codepen-snippet title="Simple Form" slug="dyNzzWZ" :height="368" tab="js,result" theme="light" :preview="false" :editable="false" />
2525

2626
Notice how you can include `autocomplete='on'` on the form element and it will apply to all inputs in your form. You can also set different [values for autocomplete attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for each input.
2727

@@ -34,7 +34,7 @@ Provide labels to describe the purpose of all form control; linking `for` and `i
3434
<input type="text" name="name" id="name" v-model="name" />
3535
```
3636

37-
<common-codepen-snippet title="Form Label" slug="wvMrGqz" :height="265" tab="js,result" :team="false" user="mlama007" name="Maria" theme="light" :preview="false" :editable="false" />
37+
<common-codepen-snippet title="Form Label" slug="XWpaaaj" :height="265" tab="js,result" theme="light" :preview="false" :editable="false" />
3838

3939
If you inspect this element in your chrome developer tools and open the Accessibility tab inside the Elements tab, you will see how the input gets its name from the label:
4040

@@ -68,7 +68,7 @@ You can also give the input an accessible name with [`aria-label`](https://devel
6868
/>
6969
```
7070

71-
<common-codepen-snippet title="Form ARIA label" slug="jOWGqgz" :height="265" tab="js,result" :team="false" user="mlama007" name="Maria" theme="light" :preview="false" :editable="false" />
71+
<common-codepen-snippet title="Form ARIA label" slug="NWdvvYQ" :height="265" tab="js,result" theme="light" :preview="false" :editable="false" />
7272

7373
Feel free to inspect this element in Chrome DevTools to see how the accessible name has changed:
7474

@@ -100,7 +100,7 @@ Using [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibi
100100
</form>
101101
```
102102

103-
<common-codepen-snippet title="Form ARIA labelledby" slug="ZEQXOLP" :height="265" tab="js,result" :team="false" user="mlama007" name="Maria" theme="light" :preview="false" :editable="false" />
103+
<common-codepen-snippet title="Form ARIA labelledby" slug="MWJvvBe" :height="265" tab="js,result" theme="light" :preview="false" :editable="false" />
104104

105105
![Chrome Developer Tools showing input accessible name from aria-labelledby](/images/AccessibleARIAlabelledbyDevTools.png)
106106

@@ -132,7 +132,7 @@ Using [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibi
132132
</form>
133133
```
134134

135-
<common-codepen-snippet title="Form ARIA describedby" slug="JjGrKyY" :height="265" tab="js,result" :team="false" user="mlama007" name="Maria" theme="light" :preview="false" :editable="false" />
135+
<common-codepen-snippet title="Form ARIA describedby" slug="gOgxxQE" :height="265" tab="js,result" theme="light" :preview="false" :editable="false" />
136136

137137
You can see the description by inspecting Chrome DevTools:
138138

@@ -144,7 +144,7 @@ Avoid using placeholders as they can confuse many users.
144144

145145
One of the issues with placeholders is that they don't meet the [color contrast criteria](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html) by default; fixing the color contrast makes the placeholder look like pre-populated data in the input fields. Looking at the following example, you can see that the Last Name placeholder which meets the color contrast criteria looks like pre-populated data:
146146

147-
<common-codepen-snippet title="Form Placeholder" slug="PoZJzeQ" :height="265" tab="js,result" :team="false" user="mlama007" name="Maria" theme="light" :preview="false" :editable="false" />
147+
<common-codepen-snippet title="Form Placeholder" slug="ExZvvMw" :height="265" tab="js,result" theme="light" :preview="false" :editable="false" />
148148

149149
It is best to provide all the information the user needs to fill out forms outside any inputs.
150150

@@ -178,7 +178,7 @@ Alternatively, you can attach the instructions to the input with [`aria-describe
178178
</fieldset>
179179
```
180180

181-
<common-codepen-snippet title="Form Instructions" slug="GRoMqYy" :height="265" tab="js,result" :team="false" user="mlama007" name="Maria" theme="light" :preview="false" :editable="false" />
181+
<common-codepen-snippet title="Form Instructions" slug="WNREEqv" :height="265" tab="js,result" theme="light" :preview="false" :editable="false" />
182182

183183
### Hiding Content
184184

@@ -212,7 +212,7 @@ We can use CSS to visually hide elements but keep them available for assistive t
212212
}
213213
```
214214

215-
<common-codepen-snippet title="Form Search" slug="qBbpQwB" :height="265" tab="js,result" :team="false" user="mlama007" name="Maria" theme="light" :preview="false" :editable="false" />
215+
<common-codepen-snippet title="Form Search" slug="QWdMqWy" :height="265" tab="js,result" theme="light" :preview="false" :editable="false" />
216216

217217
#### aria-hidden="true"
218218

@@ -240,7 +240,7 @@ You can also use an input to create buttons:
240240
</form>
241241
```
242242

243-
<common-codepen-snippet title="Form Buttons" slug="PoZEXoj" :height="467" tab="js,result" :team="false" user="mlama007" name="Maria" theme="light" :preview="false" :editable="false" />
243+
<common-codepen-snippet title="Form Buttons" slug="JjEyrYZ" :height="467" tab="js,result" theme="light" :preview="false" :editable="false" />
244244

245245
#### Functional Images
246246

@@ -276,4 +276,4 @@ You can use this technique to create functional images.
276276
</form>
277277
```
278278

279-
<common-codepen-snippet title="Functional Images" slug="NWxXeqY" :height="265" tab="js,result" :team="false" user="mlama007" name="Maria" theme="light" :preview="false" :editable="false" />
279+
<common-codepen-snippet title="Functional Images" slug="jOyLGqM" :height="265" tab="js,result" theme="light" :preview="false" :editable="false" />

0 commit comments

Comments
 (0)