Skip to content

Commit d655aef

Browse files
committed
Add Refactoring Accessibility
1 parent f4b5d09 commit d655aef

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

apps/components_guide_web/lib/components_guide_web/controllers/accessibility_first_controller.ex

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ defmodule ComponentsGuideWeb.AccessibilityFirstController do
2020
|> render("properties-cheatsheet.html")
2121
end
2222

23-
@articles ["navigation", "landmarks", "roles", "accessible-name", "forms", "content"]
23+
@articles ["navigation", "landmarks", "roles", "accessible-name", "forms", "content", "refactoring-accessibility"]
2424

2525
def show(conn, %{"id" => article}) when article in @articles do
2626
conn
@@ -38,13 +38,11 @@ defmodule ComponentsGuideWeb.AccessibilityFirstController do
3838
defp page_title("forms"), do: "Accessibility-First Forms"
3939
defp page_title("content"), do: "Accessibility-First Content"
4040
defp page_title("accessible-name"), do: "Learning Accessible Names"
41+
defp page_title("refactoring-accessibility"), do: "Refactoring Accessibility"
4142

4243
defp page_title(_) do
4344
"Accessibility-First Development"
4445
end
45-
46-
defp render_nav("content"), do: "Hello"
47-
defp render_nav(_), do: ""
4846
end
4947

5048
defmodule ComponentsGuideWeb.AccessibilityFirstView do
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Refactoring Accessibility
2+
3+
## Headings
4+
5+
- When to use `<h1>`?
6+
- Examples from news websites of their hierarchy
7+
8+
Here’s an example from The Economist:
9+
10+
```html
11+
<header>
12+
<h1>
13+
<span>
14+
Silent sigh
15+
</span>
16+
<br>
17+
<span itemprop="headline">
18+
South Korea is pushing America for new talks with the North
19+
</span>
20+
</h1>
21+
<p itemprop="description">
22+
The 70-year stalemate between the two Koreas is unlikely to break without fresh diplomacy
23+
</p>
24+
</header>
25+
```
26+
27+
## Navigation
28+
29+
- `class="current"`
30+
- `aria-current="page"`
31+
32+

0 commit comments

Comments
 (0)