Skip to content

Commit 4dfb12b

Browse files
committed
Improve content
1 parent e56e6af commit 4dfb12b

File tree

10 files changed

+44
-26
lines changed

10 files changed

+44
-26
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defmodule ComponentsGuideWeb.AccessibilityFirstController do
1818
render(conn, "properties-cheatsheet.html")
1919
end
2020

21-
@articles ["navigation", "forms"]
21+
@articles ["navigation", "forms", "content"]
2222

2323
def show(conn, %{"id" => article}) when article in @articles do
2424
render(conn, "index.html", article: article)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<header class="text-white" style="<%= header_styles() %>">
2+
<div class="mx-auto max-w-4xl">
3+
<h1 class="pt-8 row space-x-4 text-4xl text-center font-bold leading-tight text-shadow">
4+
<span class="mr-2 text-4xl">💁🏼‍♀️🥇</span>
5+
<span><%= "Accessibility-First" %></span>
6+
</h1>
7+
<%= render ComponentsGuideWeb.AccessibilityFirstView, "_nav.html" %>
8+
</div>
9+
</header>

apps/components_guide_web/lib/components_guide_web/templates/accessibility_first/_nav.html.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<nav class="pt-6 pb-4">
2-
<ul class="list-none row font-bold" style="--link-padding: 0.75em">
2+
<ul y-y x-x=md class="font-bold text-shadow" style="--link-padding: 0.75em">
33
<li><%= link("Intro", to: '/accessibility-first') %>
44
<li><%= link("Navigation", to: '/accessibility-first/navigation') %>
55
<li><%= link("Content", to: '/accessibility-first/content') %>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Headings
2+
3+
## Lists
4+
5+
## Term & Definition
6+
7+
## Figure
8+
9+
## Details & Summary
10+
11+
## Separator

apps/components_guide_web/lib/components_guide_web/templates/accessibility_first/index.html.eex

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
<header class="text-white" style="<%= header_styles() %>">
2-
<div class="mx-auto max-w-4xl">
3-
<h1 class="pt-8 row space-x-4 text-4xl text-center font-bold leading-tight text-shadow">
4-
<div class="row">
5-
<span class="mr-2 text-4xl">💁🏼‍♀️🥇</span>
6-
</div>
7-
<span><%= "Accessibility-First" %></span>
8-
</h1>
9-
<%= render @view_module, "_nav.html" %>
10-
</div>
11-
</header>
1+
<%= render @view_module, "_header.html" %>
122

133
<article>
144
<div class="text-white bg-gray-900">

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

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@
4343
] %>
4444

4545
<section aria-labelledby="hidden-all-heading">
46-
<%= h3.("Hide to everyone", id: "hidden-all-heading") %>
46+
<%= h3.("Hidden to everyone", id: "hidden-all-heading") %>
4747
<%= h4.("Test") %>
4848
<%=
4949
"""
5050
it("is hidden", () => {
51-
expect(screen.queryByRole('link', { name: 'Sign In' })).toBeNull();
51+
expect(screen.queryByRole('link', { name: 'Profile' })).toBeNull();
5252
})
5353
""" |> code_block(:js)
5454
%>
5555
<%= h4.("Markup") %>
5656
<%=
5757
"""
58-
<a href="/signin" hidden>Sign In</a>
58+
<a href="/profile" hidden>Profile</a>
5959
""" |> code_block(:html)
6060
%>
6161
<%= h4.("Styling") %>
@@ -69,27 +69,30 @@
6969
</section>
7070

7171
<section aria-labelledby="hidden-visually-heading">
72-
<%= h3.("Screen reader affordance: hide visually", id: "hidden-visually-heading") %>
72+
<%= h3.("Visually hidden (assistive technology affordance)", id: "hidden-visually-heading") %>
7373
<%= h4.("Test") %>
7474
<%=
7575
"""
7676
it("can still be found by our tests and by screen readers", () => {
7777
expect(
78-
screen.getByRole('link', { name: 'Sign In' })
78+
screen.getByRole('link', { name: 'Profile' })
7979
).toBeInTheDocument();
8080
})
8181
""" |> code_block(:js)
8282
%>
8383
<%= h4.("Markup") %>
8484
<%=
8585
"""
86-
<a href="/signin" class="visually-hidden">Sign In</a>
86+
<a href="/profile">
87+
<span class="fas fa-user"></span>
88+
<span visually-hidden>Profile</span>
89+
</a>
8790
""" |> code_block(:html)
8891
%>
8992
<%= h4.("Styling") %>
9093
<%=
9194
"""
92-
.visually-hidden {
95+
[visually-hidden] {
9396
position: absolute;
9497
overflow: hidden;
9598
clip: rect(0 0 0 0);
@@ -105,20 +108,22 @@
105108

106109
<section aria-labelledby="hidden-screen-heading">
107110
<%= h3.("Visual affordance: hide to screen reader users", id: "hidden-screen-heading") %>
111+
<%= h4.("Test") %>
108112
<%=
109113
"""
110114
it("ignores emoji in accessible name", () => {
111115
expect(
112-
screen.getByRole('link', { name: 'Sign In' })
116+
screen.getByRole('link', { name: 'Profile' })
113117
).toBeInTheDocument();
114118
})
115119
""" |> code_block(:js)
116120
%>
121+
<%= h4.("Markup") %>
117122
<%=
118123
"""
119-
<a href="/signin">
120-
<span aria-hidden="true">👉</span>
121-
Sign In
124+
<a href="/profile">
125+
<span aria-hidden=true>👤</span>
126+
Profile
122127
</a>
123128
""" |> code_block(:html)
124129
%>
@@ -128,6 +133,7 @@
128133
<%= h3.("Notes", id: "hidden-notes-heading") %>
129134
<ul>
130135
<li><%= link("Scott O’Hara: Inclusively Hidden", to: "https://www.scottohara.me/blog/2017/04/14/inclusively-hidden.html") %>
136+
<li><%= link("Scott O’Hara: Know your ARIA: ‘Hidden’ vs ‘None’", to: "https://www.scottohara.me/blog/2018/05/05/hidden-vs-none.html") %>
131137
<li><%= link("MDN: Using the aria-hidden attribute", to: "https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-hidden_attribute") %>
132138
<li><%= link("Places it’s tempting to use `display: none;`, but don’t ", to: "https://css-tricks.com/places-its-tempting-to-use-display-none-but-dont/") %>
133139
</ul>

apps/components_guide_web/lib/components_guide_web/templates/layout/_banner.html.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<header role=banner class="bg-gray-900 text-white">
2-
<div class="px-4 flex flex-col md:flex-row items-stretch text-center md:text-left">
2+
<div y-y x-x=md p-l p-r class="pb-4 md:pb-0 text-center md:text-left">
33
<a href="/" class="block px-3 py-2 md:py-4 md:text-right text-sm md:text-base font-bold italic uppercase leading-tight tracking-wide hover:bg-gray-800">
44
<span>Components <br>·Guide</span>
55
</a>

apps/components_guide_web/lib/components_guide_web/templates/layout/root.html.leex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<%= csrf_meta_tag() %>
88
<%= live_title_tag assigns[:page_title] || "Guides to React, Accessibility, Modern CSS, TypeScript", suffix: " · Components.Guide" %>
99
<link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
10+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/RoyalIcing/tela@0d21d625a3c131a5a270c24ffb2b503f6e20bdc4/tela.css"/>
1011
<script defer type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
1112
</head>
1213
<body>

apps/components_guide_web/lib/components_guide_web/templates/react_typescript/index.html.eex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<ul class="list-none row font-bold" style="--link-padding: 0.75em">
1313
<li><%= link("Fundamentals", to: '/react+typescript') %>
1414
<li><%= link("Testing", to: '/react+typescript/testing') %>
15+
<li><%= link("Forms", to: '/react+typescript/forms') %>
1516
</ul>
1617
</nav>
1718
</header>

apps/components_guide_web/lib/components_guide_web/templates/react_typescript/testing.html.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ This is what accessibility-first testing allows us to achieve. And as a massive
102102
["**definition**", "`<dd>`"],
103103
["**img**", "`<img alt=\"Some description\">`"],
104104
["_none_", "`<img alt=\"\">`"],
105-
["**separator**", "`<hr>`"],
106105
["**figure**", "`<figure>`"],
106+
["**separator**", "`<hr>`, `<li role=separator>`"],
107107
["_none_", "`<p>`"],
108108
["_none_", "`<div>`"],
109109
["_none_", "`<span>`"],

0 commit comments

Comments
 (0)