Skip to content

Commit 0b76cc0

Browse files
committed
feat: update content
1 parent 7a0aca9 commit 0b76cc0

File tree

10 files changed

+55
-98
lines changed

10 files changed

+55
-98
lines changed

.vitepress/config.mts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ export default defineConfig({
1616
{ text: "Visibility Methods", link: "/visibility-methods" },
1717
// { text: "Accessible Multimedia", link: "/multimedia" },
1818
{ text: "Focus Control", link: "/focus-control" },
19-
{
20-
text: "Mouse and Pointer Events",
21-
link: "/mouse-and-pointer-events",
22-
},
19+
// {
20+
// text: "Mouse and Pointer Events",
21+
// link: "/mouse-and-pointer-events",
22+
// },
2323
{ text: "Complex Widgets", link: "/complex-widgets" },
2424
{ text: "Development Checklists", link: "/dev-checklists" },
2525
{ text: "Tools", link: "/tools" },
26+
{ text: "Exercise", link: "/exercise" },
2627
{ text: "References", link: "/references" },
2728
],
2829
},

assets/a11y.svg

Lines changed: 4 additions & 0 deletions
Loading

assets/dog.jpg

1.42 MB
Loading

assets/spider-sense.jpg

386 KB
Loading

dev-checklists.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ outline: "deep"
1717

1818
# Development Checklists
1919

20-
There are a number of tools we can use to assist in the creation of accessible web applications.
20+
![Image of the spider-man with triggered spider-sense](./assets/spider-sense.jpg)
21+
22+
23+
There are a number of tools we can use to assist in the creation of accessible web applications.
24+
25+
Here are some common issues that should make your spidey senses go off. My goal is for you to be able to identify these in code reviews and demos.
26+
27+
We want to bring kindness to these situations and not judge people. We also need to identify accessibility issues (ideally) before they ship:
2128

2229
## Keyboard Navigation
2330

@@ -73,7 +80,8 @@ Non-modal dialogs don’t have all of the same background requirements. But the
7380
<tapsi-button @click="openModal" variant="brand" id="open-modal-btn">Open a sample modal</tapsi-button>
7481
<tapsi-modal style="z-index: 999" id="sample-modal" heading="a sample modal" description="As you can see. the focus is now on the first focusable element inside the modal.">
7582
<tapsi-button-group slot="action-bar">
76-
<tapsi-button @click="closeModal">Got it</tapsi-button>
83+
<tapsi-button @click="closeModal">button 1</tapsi-button>
84+
<tapsi-button @click="closeModal">button 2</tapsi-button>
7785
</tapsi-button-group>
7886
</tapsi-modal>
7987

@@ -133,7 +141,7 @@ const MyComponent = () => {
133141
}
134142

135143
const handleKeyDown = (e: KeyboardEvent) => { // [!code focus]
136-
if (event.code === 'Space' || event.code === 'Enter') { // [!code focus]
144+
if (e.code === 'Space' || e.code === 'Enter') { // [!code focus]
137145
fn(); // [!code focus]
138146
} // [!code focus]
139147
} // [!code focus]

exercise.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
outline: "deep"
3+
---
4+
5+
# Exercise
6+
7+
![A cute dog wearing glasses behind a laptop trying to code!](./assets/dog.jpg)
8+
9+
Please fork the [React Accessibility Exercise](https://github.com/code-with-amirhossein/react-a11y-exercise), Read the [`README.md`](https://github.com/code-with-amirhossein/react-a11y-exercise/blob/main/README.md) file carefully and make the app accessible!
10+
11+
Good luck ✨

focus-control.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ Ensure that your web application can be fully operated with the keyboard only:
1313

1414
- [WebAIM talks about keyboard accessibility](https://webaim.org/techniques/keyboard/)
1515

16-
## Keyboard focus and focus outline
16+
## Keyboard focus and focus outline (focus ring)
1717

1818
Keyboard focus refers to the current element in the DOM that is selected to accept input from the keyboard. We see it everywhere as a focus outline similar to that shown in the following image:
1919

2020
[![Blue keyboard focus outline around a selected link.](https://legacy.reactjs.org/static/dec0e6bcc1f882baf76ebc860d4f04e5/4fcfe/keyboard-focus.png)](https://legacy.reactjs.org/static/dec0e6bcc1f882baf76ebc860d4f04e5/4fcfe/keyboard-focus.png)
2121

2222
Only ever use CSS that removes this outline, for example by setting `outline: 0`, if you are replacing it with another focus outline implementation.
2323

24+
Here are some examples of custom focus rings in [Tapsi design system](https://github.com/Tap30/web-components):
25+
2426
<section aria-hidden="true" style="background: white; border-radius: 8px; padding: 12px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;">
2527

2628
<tapsi-button variant="brand">عنوان دکمه</tapsi-button>

index.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,32 @@ hero:
66
name: "Accessibility"
77
text: "for React Developers"
88
tagline: 🚧 Work in Progress
9+
image:
10+
src: ./assets/a11y.svg
11+
alt: accessibility icon
912
actions:
1013
- theme: brand
1114
text: Get Started!
1215
link: /intro
1316
---
1417

1518
<style>
19+
20+
.VPImage {
21+
color: var(--vp-c-brand-1);
22+
animation: a11y-icon 1s;
23+
24+
}
25+
26+
@keyframes a11y-icon {
27+
from {
28+
opacity: 0;
29+
}
30+
to {
31+
opacity: 1;
32+
}
33+
}
34+
1635
#author {
1736
display: flex;
1837
align-items: center;

intro.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,14 @@ outline: 'deep'
55

66
# What is accessibility?
77

8+
<svg style="width: 10rem; margin: 2rem auto" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>human</title><path d="M21,9H15V22H13V16H11V22H9V9H3V7H21M12,2A2,2 0 0,1 14,4A2,2 0 0,1 12,6C10.89,6 10,5.1 10,4C10,2.89 10.89,2 12,2Z" fill="var(--vp-c-brand-1)" /></svg>
9+
810
Accessibility is the practice of making your websites usable by as many people as possible. We traditionally think of this as being about people with disabilities, but the practice of making sites accessible also benefits other groups such as those using mobile devices, or those with slow network connections.
911

1012
You might also think of accessibility as treating everyone the same, and giving them equal opportunities, no matter what their ability or circumstances. Just as it is wrong to exclude someone from a physical building because they are in a wheelchair (modern public buildings generally have wheelchair ramps or elevators), it is also not right to exclude someone from a website because they have a visual impairment. We are all different, but we are all human, and therefore have the same human rights.
1113

1214
Accessibility is the right thing to do. Providing accessible sites is part of the law in some countries, which can open up some significant markets that otherwise would not be able to use your services or buy your products.
1315

14-
There are 3 levels of disabilities:
15-
- permanent disablilties
16-
<!-- People who are deaf or hard of hearing, People who are blind or low vision using screen reader. People with auditory processing difficulties. -->
17-
- temporary disabilities
18-
<!-- Have you ever go to the optometrist and they dilate your eyes and everythin is very washed out. You have hard time seeing until the medication wears off, that's a temporary type of disability. -->
19-
- situational disabilities
20-
<!--youre on the bus and want to watch a video-->
21-
2216
## What kinds of disability are we looking at?
2317

2418
People with disabilities are just as diverse as people without disabilities, and so are their disabilities. The key lesson here is to think beyond your own computer and how you use the web, and start learning about how others use it — you are not your users. The main types of disability to consider are explained below, along with any special tools they use to access web content (known as assistive technologies, or ATs).

wai-aria.md

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -2,87 +2,6 @@
22
outline: "deep"
33
---
44

5-
<script setup>
6-
7-
const formIframeSrcDoc = `
8-
<!DOCTYPE html>
9-
<html lang="en">
10-
<head>
11-
<meta charset="UTF-8" />
12-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
13-
<title>Accessible Form Example</title>
14-
</head>
15-
<body>
16-
<h1>Form for Testing Accessibility</h1>
17-
<main>
18-
<form class="form js-form" id="f" action="#">
19-
<fieldset class="form__data">
20-
<legend>Subscribe now</legend>
21-
<div class="form__name">
22-
<label
23-
for="firstname"
24-
data-validation="We need your first name to address you correctly"
25-
>
26-
<span class="form__field-name">First name</span>
27-
<span aria-hidden="true" class="form__required">(required)</span>
28-
</label>
29-
<input
30-
aria-describedby="firstname-validation"
31-
required
32-
id="firstname"
33-
name="firstname"
34-
type="text"
35-
autocomplete="given-name"
36-
/>
37-
<small id="firstname-validation" class="form__validation"></small>
38-
</div>
39-
<div class="form__name">
40-
<label
41-
for="lastname"
42-
data-validation="We need your last name to address you correctly"
43-
>
44-
<span class="form__field-name">Last name</span>
45-
<span aria-hidden="true" class="form__required">(required)</span>
46-
</label>
47-
<input
48-
aria-describedby="lastname-validation"
49-
required
50-
id="lastname"
51-
name="lastname"
52-
type="text"
53-
autocomplete="family-name"
54-
/>
55-
<small id="lastname-validation" class="form__validation"></small>
56-
</div>
57-
<div class="form__email">
58-
<label
59-
for="email"
60-
data-validation="We need your email address to be able to send you the newsletter"
61-
>
62-
<span class="form__field-name">Email address</span>
63-
<span aria-hidden="true" class="form__required">(required)</span>
64-
</label>
65-
<input
66-
aria-describedby="email-validation"
67-
required
68-
id="email"
69-
name="email"
70-
type="email"
71-
autocomplete="email"
72-
/>
73-
<small id="email-validation" class="form__validation"></small>
74-
</div>
75-
</fieldset>
76-
77-
<button class="button button--red" type="submit">Subscribe</button>
78-
</form>
79-
</main>
80-
<script>document.getElementById("f").addEventListener("submit", (e) => {e.preventDefault();console.log("submitted!");});<\/script>
81-
</body>
82-
</html>
83-
`
84-
</script>
85-
865
# WAI-ARIA
876

887
The [Web Accessibility Initiative - Accessible Rich Internet Applications](https://www.w3.org/WAI/intro/aria) (WAI-ARIA) document contains techniques for building fully accessible JavaScript widgets and web applications. It defines a set of attributes to help make web content and web applications more accessible to people with disabilities.
@@ -216,4 +135,3 @@ Here's an example!
216135

217136
In this example, we have a table whose column headers have buttons that will sort the table. That sorting behavior is made evident for sighted users with some recognizable sort icon, but blind users wouldn't get any cues to the buttons' functionality. To compensate, we give the button a description using aria-describedby, pointing to a `<p>` tag outside of the table. We wouldn't want users to navigate to the `<p>` on its own, however, so we apply hidden to it. Now our sort button has a description of "Sort this table alphabetically by name." without any of the ensuing clutter! 🙌🏻
218137

219-
<iframe :srcdoc="formIframeSrcDoc"></iframe>

0 commit comments

Comments
 (0)