Skip to content

Commit 1d0d8d3

Browse files
committed
Add landmarks
1 parent e3aac49 commit 1d0d8d3

File tree

6 files changed

+36
-7
lines changed

6 files changed

+36
-7
lines changed
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
defmodule ComponentsGuideWeb.AccessibilityFirstController do
22
use ComponentsGuideWeb, :controller
3+
require Logger
34

45
def index(conn, _params) do
56
render(conn, "index.html")
67
end
78

8-
def show(conn, _params) do
9+
def show(conn, %{"id" => "landmarks"}) do
10+
render(conn, "landmarks.html")
11+
end
12+
13+
def show(conn, %{"id" => "roles-cheatsheet"}) do
914
render(conn, "roles-cheatsheet.html")
1015
end
16+
17+
def show(conn, _params) do
18+
raise Phoenix.Router.NoRouteError, conn: conn, router: ComponentsGuideWeb.Router
19+
end
1120
end

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ topics = [
1919
<header class="text-white" style="background: <%= header_background() %>;">
2020
<section class="container px-6 pt-12 pb-12">
2121
<h1 class="mx-auto max-w-4xl text-5xl text-center font-bold leading-tight text-shadow">
22-
<%= "🥇 Accessibility-First Testing" %>
22+
<%= "🥇 Accessibility-First Development" %>
2323
</h1>
24-
<p class="my-8 mx-auto max-w-3xl text-4xl text-center leading-snug italic text-yellow-100 text-shadow">
24+
<p class="my-8 mx-auto max-w-3xl text-4xl text-center leading-snug italic text-shadow">
2525
<%#= "Write simpler, more robust tests using accessibility affordances." %>
2626
<%= "Write simpler, more robust tests via user-friendly accessibility affordances." %>
2727
</p>
@@ -37,6 +37,9 @@ topics = [
3737
<div class="bg-white">
3838
<%= section "Topics", class: "container pt-8 pb-16 text-2xl" do %>
3939
<%= topic_article(title: "Landmarks and roles", link: Routes.accessibility_first_path(@conn, :show, "roles-cheatsheet")) do %>
40+
<ul>
41+
<li><%= link("Orienting web visitors using landmarks", to: "#") %>
42+
</ul>
4043
<p>Define what your elements are using a clear standard. Let your users quickly jump around the key parts of your page (better UX), and leverage those in your tests (better DX).</p>
4144
<% end %>
4245
<%= topic_article(title: "Widgets, Attributes & States") do %>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<%
2+
theme = %Theme{text_color: "blue"}
3+
[h2, h3] = Theme.headings(theme)
4+
%>
5+
<header class="text-white" style="background: <%= header_background %>;">
6+
<section class="container px-6 pt-6 pb-6">
7+
<h1 class="mx-auto max-w-4xl text-5xl text-center font-bold leading-tight text-shadow">
8+
<%= "Landmarks" %>
9+
</h1>
10+
</section>
11+
</header>
12+
13+
<div class="text-base lg:text-lg bg-gray-900">
14+
<article class="container">
15+
<%= h2.("Orienting web visitors using landmarks", id: "landmarks-royal-icing") %>
16+
</article>
17+
</div>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</section>
1414
</header>
1515

16-
<div class="text-base lg:text-xl flex items-stretch bg-gray-900">
16+
<div class="text-base lg:text-lg flex items-stretch bg-gray-900">
1717
<nav class="w-48 lg:w-64 bg-gray-100 border-r border-gray-200">
1818
<ul class="sticky top-0 p-4 pl-6 list-none leading-loose">
1919
<li><%= link "Link", to: "#link" %>
@@ -227,4 +227,4 @@
227227

228228
</section>
229229
</div>
230-
</div>
230+
</div>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ subhead = "Learn more of the why than the how."
8282
<%= stack_list([
8383
%{ title: "Landmarks", description: "Ensure your web pages have these familiar regions.", to: "#", color: "indigo" },
8484
%{ title: "Widgets", description: "Buttons, links, tabs, comboboxes, and more.", to: "#", color: "orange" },
85-
%{ title: "Accessibility-First TDD", description: "Use accessibility affordances to write robust tests.", to: "/accessibility-first", color: "green" },
85+
%{ title: "Accessibility-First TDD", description: "Use accessibility affordances to write robust tests.", to: "/accessibility-first/roles-cheatsheet", color: "green" },
8686
%{ title: "Keyboard Navigation Acceptance Tests", description: "Ensure your forms are keyboard accessibility.", to: "/accessibility-first", color: "blue" },
8787
]) %>
8888
</section>

apps/components_guide_web/lib/components_guide_web/views/layout_view.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defmodule ComponentsGuideWeb.LayoutView do
1818
~E"""
1919
<li>
2020
<form role=search action="/research" class="flex h-full px-2 items-center">
21-
<input type=text name=q placeholder="Search specs" class="w-full py-1 px-2 bg-white text-black">
21+
<input type=text name=q placeholder="Search specs, libraries, blog posts" class="w-full py-1 px-2 bg-white text-black">
2222
</form>
2323
"""
2424
end

0 commit comments

Comments
 (0)