Skip to content

Commit c8a4a3c

Browse files
committed
Improve hiding guide
1 parent 8e5f668 commit c8a4a3c

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

apps/components_guide_web/lib/components_guide_web/templates/accessibility_first/properties-cheatsheet.html.eex

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,18 @@
3434
<article aria-labelledby="hidden" class="space-y-4">
3535
<%= h2.("I want to hide an element", id: "hidden") %>
3636

37-
<p>You can hide using a large range of techniques. What you first want to ask is, from whom do I want to hide the content?
37+
<p>You can hide using a large range of techniques. What you first want to ask is, to whom do I want to show the content?
3838

3939
<%= list [
40-
"Hide from **everyone**.",
41-
"**Screen reader affordance:** hide to sighted users, but show to screen reader users.",
42-
"**Visual affordance:** hide to screen reader users, but show to sighted users."
40+
"Show to **everyone**. 👂✅ 👁✅",
41+
"Hide from **everyone**. 👂❌ 👁❌",
42+
"**Screen reader affordance:** show to screen reader users, hide to sighted users. 👂✅ 👁❌",
43+
"**Visual affordance:** show to sighted users, hide to screen reader users. 👂❌ 👁✅"
4344
] %>
4445

4546
<section aria-labelledby="hidden-all-heading">
4647
<%= h3.("Hidden to everyone", id: "hidden-all-heading") %>
48+
<p>To hide to everyone, add the <code>hidden</code> attribute.</p>
4749
<%= h4.("Test") %>
4850
<%=
4951
"""
@@ -69,7 +71,9 @@
6971
</section>
7072

7173
<section aria-labelledby="hidden-visually-heading">
72-
<%= h3.("Visually hidden (assistive technology affordance)", id: "hidden-visually-heading") %>
74+
<%#= h3.("Visually hidden (assistive technology only)", id: "hidden-visually-heading") %>
75+
<%= h3.("Assistive technology affordance (visually hidden)", id: "hidden-visually-heading") %>
76+
<p>To show to assistive technology but hide visually, add the <code>visually-hidden</code> class.</p>
7377
<%= h4.("Test") %>
7478
<%=
7579
"""
@@ -84,15 +88,15 @@
8488
<%=
8589
"""
8690
<a href="/profile">
87-
<span class="fas fa-user"></span>
88-
<span visually-hidden>Profile</span>
91+
<span class="icon-user"></span>
92+
<span class="visually-hidden">Profile</span>
8993
</a>
9094
""" |> code_block(:html)
9195
%>
9296
<%= h4.("Styling") %>
9397
<%=
9498
"""
95-
[visually-hidden] {
99+
.visually-hidden {
96100
position: absolute;
97101
overflow: hidden;
98102
clip: rect(0 0 0 0);
@@ -107,11 +111,12 @@
107111
</section>
108112

109113
<section aria-labelledby="hidden-screen-heading">
110-
<%= h3.("Visual affordance: hide to screen reader users", id: "hidden-screen-heading") %>
114+
<%= h3.("Visual affordance (hidden to assistive technology)", id: "hidden-screen-heading") %>
115+
<p>To show visually but hide to assistive technology, add the <code>aria-hidden</code> attribute.</p>
111116
<%= h4.("Test") %>
112117
<%=
113118
"""
114-
it("ignores emoji in accessible name", () => {
119+
it("does not include emoji in accessible name", () => {
115120
expect(
116121
screen.getByRole('link', { name: 'Profile' })
117122
).toBeInTheDocument();

0 commit comments

Comments
 (0)