Skip to content

Commit

Permalink
style: run prettier on learn (#20538)
Browse files Browse the repository at this point in the history
* style: run prettier on learn

* fix: re-escape tags in alt for Markdownlint

* Update files/en-us/learn/html/introduction_to_html/the_head_metadata_in_html/index.md

Co-authored-by: Jean-Yves Perrier <jypenator@gmail.com>

* Update files/en-us/learn/common_questions/what_are_browser_developer_tools/index.md

Co-authored-by: Jean-Yves Perrier <jypenator@gmail.com>

* Update files/en-us/learn/common_questions/what_are_browser_developer_tools/index.md

Co-authored-by: Jean-Yves Perrier <jypenator@gmail.com>

* fix: replace HTML only alt text

* Remove extra trailing spaces

Co-authored-by: Jean-Yves Perrier <jypenator@gmail.com>
  • Loading branch information
nschonni and teoli2003 committed Sep 11, 2022
1 parent dadaa03 commit 4f6ba2f
Show file tree
Hide file tree
Showing 162 changed files with 4,534 additions and 4,525 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ If you would like your work assessed, or are stuck and want to ask for help:
1. Put your work into an online shareable editor such as [CodePen](https://codepen.io/), [jsFiddle](https://jsfiddle.net/), or [Glitch](https://glitch.com/).
2. Write a post asking for assessment and/or help at the [MDN Discourse forum Learning category](https://discourse.mozilla.org/c/mdn/learn/250). Your post should include:

- A descriptive title such as "Assessment wanted for Accessibility troubleshooting".
- Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment.
- A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
- A link to the actual task or assessment page, so we can find the question you want help with.
- A descriptive title such as "Assessment wanted for Accessibility troubleshooting".
- Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment.
- A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
- A link to the actual task or assessment page, so we can find the question you want help with.

{{PreviousMenu("Learn/Accessibility/Mobile", "Learn/Accessibility")}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ If you would like your work assessed, or are stuck and want to ask for help:
1. Put your work into an online shareable editor such as [CodePen](https://codepen.io/), [jsFiddle](https://jsfiddle.net/), or [Glitch](https://glitch.com/). You can write the code yourself, or use the starting point files linked to in the above sections.
2. Write a post asking for assessment and/or help at the [MDN Discourse forum Learning category](https://discourse.mozilla.org/c/mdn/learn/250). Your post should include:

- A descriptive title such as "Assessment wanted for CSS accessibility 1 skill test".
- Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment.
- A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
- A link to the actual task or assessment page, so we can find the question you want help with.
- A descriptive title such as "Assessment wanted for CSS accessibility 1 skill test".
- Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment.
- A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
- A link to the actual task or assessment page, so we can find the question you want help with.
2 changes: 1 addition & 1 deletion files/en-us/learn/accessibility/html/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ This highlights the importance of not only using meaningful file names in case s

Note that the contents of the `alt` attribute should always provide a direct representation of the image and what it conveys visually. The alt should be brief and concise and include all the information conveyed in the image that is not duplicated in the surrounding text.

The content of the `alt` attribute for a single image differs based on the context. For example, if the photo of Fluffy is an avatar next to a review for Yuckymeat dog food, `alt="Fluffy"` is appropriate. If the photo is part of Fluffy's adoption page for the animal rescue society, information conveyed in the image that is relevant for a prospective dog parent that is not duplicated in the surrounding text should be included. A longer description, such as `alt="Fluffy, a tri-color terrier with very short hair, with a tennis ball in her mouth."` is appropriate. As the surrounding text likely has Fluffy's size and breed, that is not included in the `alt`. However, as the dog's biography likely doesn't include hair length, colors, or toy preferences, which the potential parent needs to know, it is included. Is the image outdoors, or does Fluffy have a red collar with a blue leash? Not important in terms of adopting the pet and therefore not included. All information image conveys that a sited user can access and is relevant to the context is what needs to be conveyed; nothing more. Keep it short, precise, and useful.
The content of the `alt` attribute for a single image differs based on the context. For example, if the photo of Fluffy is an avatar next to a review for Yuckymeat dog food, `alt="Fluffy"` is appropriate. If the photo is part of Fluffy's adoption page for the animal rescue society, information conveyed in the image that is relevant for a prospective dog parent that is not duplicated in the surrounding text should be included. A longer description, such as `alt="Fluffy, a tri-color terrier with very short hair, with a tennis ball in her mouth."` is appropriate. As the surrounding text likely has Fluffy's size and breed, that is not included in the `alt`. However, as the dog's biography likely doesn't include hair length, colors, or toy preferences, which the potential parent needs to know, it is included. Is the image outdoors, or does Fluffy have a red collar with a blue leash? Not important in terms of adopting the pet and therefore not included. All information image conveys that a sited user can access and is relevant to the context is what needs to be conveyed; nothing more. Keep it short, precise, and useful.

Any personal knowledge or extra description shouldn't be included here, as it is not useful for people who have not seen the image before. If the ball is Fluffy's favorite toy or if the sited user can't know that from the image, then don't include it.

Expand Down
30 changes: 15 additions & 15 deletions files/en-us/learn/accessibility/mobile/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ For example, with TalkBack turned on:
2. Activate the URL bar.
3. Enter a web page that has a bunch of headings on it, such as the front page of bbc.co.uk. To enter the text of the URL:

- Select the URL bar by swiping left/right till you get to it, and then double-tapping.
- Hold your finger down on the virtual keyboard until you get the character you want, and then release your finger to type it. Repeat for each character.
- Once you've finished, find the Enter key and press it.
- Select the URL bar by swiping left/right till you get to it, and then double-tapping.
- Hold your finger down on the virtual keyboard until you get the character you want, and then release your finger to type it. Repeat for each character.
- Once you've finished, find the Enter key and press it.

4. Swipe left and right to move between different items on the page.
5. Swipe up and right with a smooth motion to enter the local content menu.
Expand Down Expand Up @@ -155,8 +155,8 @@ When VoiceOver is turned on, you have a navigation feature called the Rotor avai
1. Twist two fingers around on the screen like you are turning a dial. Each option will be read aloud as you twist further around. You can go back and forth to cycle through the options.
2. Once you've found the option you want:

- Release your fingers to select it.
- If it is an option you can iterate the value of (such as Volume or Speaking Rate), you can do a swipe up or down to increase or decrease the value of the selected item.
- Release your fingers to select it.
- If it is an option you can iterate the value of (such as Volume or Speaking Rate), you can do a swipe up or down to increase or decrease the value of the selected item.

The options available under the Rotor are context-sensitive — they will differ depending on what app or view you are in (see below for an example).

Expand All @@ -168,20 +168,20 @@ Let's have a go at web browsing with VoiceOver:
2. Activate the URL bar.
3. Enter a web page that has a bunch of headings on it, such as the front page of bbc.co.uk. To enter the text of the URL:

- Select the URL bar by swiping left/right until you get to it, and then double-tapping.
- For each character, hold your finger down on the virtual keyboard until you get the character you want, and then release your finger to select it. Double-tap to type it.
- Once you've finished, find the Enter key and press it.
- Select the URL bar by swiping left/right until you get to it, and then double-tapping.
- For each character, hold your finger down on the virtual keyboard until you get the character you want, and then release your finger to select it. Double-tap to type it.
- Once you've finished, find the Enter key and press it.

4. Swipe left and right to move between items on the page. You can double-tap an item to select it (e.g., follow a link).
5. By default, the selected Rotor option will be Speaking Rate; you can currently swipe up and down to increase or decrease the speaking rate.
6. Now turn two fingers around the screen like a dial to show the rotor and move between its options. Here are a few examples of the options available:

- _Speaking Rate_: Change the speaking rate.
- _Containers_: Move between different semantic containers on the page.
- _Headings_: Move between headings on the page.
- _Links_: Move between links on the page.
- _Form Controls_: Move between form controls on the page.
- _Language_: Move between different translations, if they are available.
- _Speaking Rate_: Change the speaking rate.
- _Containers_: Move between different semantic containers on the page.
- _Headings_: Move between headings on the page.
- _Links_: Move between links on the page.
- _Form Controls_: Move between form controls on the page.
- _Language_: Move between different translations, if they are available.

7. Select _Headings_. Now you'll be able to swipe up and down to move between headings on the page.

Expand Down Expand Up @@ -232,7 +232,7 @@ In particular, the most common problems that need to be addressed for mobile are

- Suitability of layouts for mobile devices. A multi-column layout won't work as well on a narrow screen, for example, and the text size may need to be increased so it is legible. Such issues can be solved by creating a responsive layout using technologies such as [media queries](/en-US/docs/Web/CSS/Media_Queries), [viewport](/en-US/docs/Web/HTML/Viewport_meta_tag), and [flexbox](/en-US/docs/Learn/CSS/CSS_layout/Flexbox).
- Conserving image sizes downloaded. In general, small screen devices won't need images that are as large as their desktop counterparts, and they are more likely to be on slow network connections. Therefore, it is wise to serve smaller images to narrow screen devices as appropriate. You can handle this using [responsive image techniques](/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images).
- Thinking about high resolutions. Many mobile devices have high-resolution screens, and therefore need higher-resolution images so that the display can continue to look crisp and sharp. Again, you can serve images as appropriate using responsive image techniques. In addition, many image requirements can be fulfilled using the SVG vector images format, which is well-supported across browsers today. SVG has a small file size and will stay sharp regardless of whatever size is being displayed (see [Adding vector graphics to the web](/en-US/docs/Learn/HTML/Multimedia_and_embedding/Adding_vector_graphics_to_the_Web) for more details).
- Thinking about high resolutions. Many mobile devices have high-resolution screens, and therefore need higher-resolution images so that the display can continue to look crisp and sharp. Again, you can serve images as appropriate using responsive image techniques. In addition, many image requirements can be fulfilled using the SVG vector images format, which is well-supported across browsers today. SVG has a small file size and will stay sharp regardless of whatever size is being displayed (see [Adding vector graphics to the web](/en-US/docs/Learn/HTML/Multimedia_and_embedding/Adding_vector_graphics_to_the_Web) for more details).

> **Note:** We won't provide a full discussion of responsive design techniques here, as they are covered in other places around MDN (see above links).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ If you would like your work assessed, or are stuck and want to ask for help:
1. Put your work into an online shareable editor such as [CodePen](https://codepen.io/), [jsFiddle](https://jsfiddle.net/), or [Glitch](https://glitch.com/). You can write the code yourself, or use the starting point files linked to in the above sections.
2. Write a post asking for assessment and/or help at the [MDN Discourse forum Learning category](https://discourse.mozilla.org/c/mdn/learn/250). Your post should include:

- A descriptive title such as "Assessment wanted for HTML accessibility 1 skill test".
- Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment.
- A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
- A link to the actual task or assessment page, so we can find the question you want help with.
- A descriptive title such as "Assessment wanted for HTML accessibility 1 skill test".
- Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment.
- A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
- A link to the actual task or assessment page, so we can find the question you want help with.
22 changes: 11 additions & 11 deletions files/en-us/learn/accessibility/wai-aria_basics/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,25 +287,25 @@ We could go further with our ARIA usage, and provide some more validation help.
2. Open them both in a text editor and have a look at how the code works.
3. First of all, add a paragraph just above the opening `<form>` tag, like the one below, and mark both the form `<label>`s with an asterisk. This is normally how we mark required fields for sighted users.

```html
<p>Fields marked with an asterisk (*) are required.</p>
```
```html
<p>Fields marked with an asterisk (*) are required.</p>
```

4. This makes visual sense, but it isn't as easy to understand for screen reader users. Fortunately, WAI-ARIA provides the [`aria-required`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-required) attribute to give screen readers hints that they should tell users that form inputs need to be filled in. Update the `<input>` elements like so:

```html
<input type="text" name="name" id="name" aria-required="true">
```html
<input type="text" name="name" id="name" aria-required="true">

<input type="number" name="age" id="age" aria-required="true">
```
<input type="number" name="age" id="age" aria-required="true">
```

5. If you save the example now and test it with a screen reader, you should hear something like "Enter your name star, required, edit text".
6. It might also be useful if we give screen reader users and sighted users an idea of what the age value should be. This is often presented as a tooltip or placeholder inside the form field. WAI-ARIA does include [`aria-valuemin`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuemin) and [`aria-valuemax`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuemax) properties to specify min and max values, and screen readers support the native `min` and `max` attributes. Another well-supported feature is the HTML `placeholder` attribute, which can contain a message that is shown in the input when no value is entered and is read out by a few screen readers. Update your number input like this:

```html
<label for="age">Your age:</label>
<input type="number" name="age" id="age" placeholder="Enter 1 to 150" required aria-required="true">
```
```html
<label for="age">Your age:</label>
<input type="number" name="age" id="age" placeholder="Enter 1 to 150" required aria-required="true">
```

Always include a {{HTMLelement('label')}} for every input. While some screen readers announce the placeholder text, most do not. Acceptable substitutions for providing form controls with an accessible name include [`aria-label`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) and [`aria-labelledby`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby). But the `<label>` element with a `for` attribute is the preferred method as it provides usability for all users, including mouse users.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ If you would like your work assessed, or are stuck and want to ask for help:
1. Put your work into an online shareable editor such as [CodePen](https://codepen.io/), [jsFiddle](https://jsfiddle.net/), or [Glitch](https://glitch.com/). You can write the code yourself, or use the starting point files linked to in the above sections.
2. Write a post asking for assessment and/or help at the [MDN Discourse forum Learning category](https://discourse.mozilla.org/c/mdn/learn/250). Your post should include:

- A descriptive title such as "Assessment wanted for WAI-ARIA 1 skill test".
- Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment.
- A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
- A link to the actual task or assessment page, so we can find the question you want help with.
- A descriptive title such as "Assessment wanted for WAI-ARIA 1 skill test".
- Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment.
- A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code.
- A link to the actual task or assessment page, so we can find the question you want help with.
Loading

0 comments on commit 4f6ba2f

Please sign in to comment.