Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit 9bc7c18

Browse files
committed
Fixed multiple h1 across Methods
Updated templates so that each method has one h1, assigned category h1 on each method category to be a header label (instead of an h1), added a visually-hidden h1 to the homepage.
1 parent daa2427 commit 9bc7c18

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

_layouts/card.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<body class="layout--card category--{{page.category | downcase }}">
55
{% include category-setup.html %} {% include header.html %}
66
<main id="main" role="main">
7-
<section class="category category--{{page.category | downcase }} usa-section usa-prose" id="{{page.category | downcase }}">
8-
<header class="category--header">
7+
<section class="category category--{{page.category | downcase }} usa-section usa-prose">
8+
<header class="category--header" aria-labelledby="{{method_category.title | downcase }}">
99
<div class="grid-container">
1010
{% assign method_category = site.pages | where: "title", page.category | first %}
11-
<h1 class="category--title">{{method_category.title | capitalize }}</h1>
11+
<span class="category--title" id="{{method_category.title | downcase }">{{method_category.title | capitalize }}</span>
1212
<p class="category--subtitle">{{method_category.description}}</p>
1313
</div>
1414
</header>

_sass/category.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
font-size: 1.5rem;
125125
margin-top: 2rem;
126126
}
127-
h2 {
127+
h3 {
128128
font-size: 1.3rem;
129129
margin-top: 2rem;
130130
}

_sass/footer.scss

+9
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,13 @@
1818
a.heading-permalink:hover,
1919
a.heading-permalink:focus {
2020
opacity: 1;
21+
}
22+
23+
// Visually hiding elements
24+
.visually-hidden {
25+
position: absolute !important;
26+
height: 1px; width: 1px;
27+
overflow: hidden;
28+
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
29+
clip: rect(1px, 1px, 1px, 1px);
2130
}

index.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@
55
---
66
<div class="usa-section intro-header">
77
<div class="grid-container">
8+
<h1 class="visually-hidden">{% if page.title %}
9+
{{ page.title }}
10+
{% endif %} </h1>
811
<p class="usa-intro no-print">A collection of tools to bring human-centered design into your project.</p>
912
</div>
1013
</div>
1114
<div class="usa-section">
1215
{% for category in site.data.categories %}
1316
<section class="usa-prose grid-container category usa-section category--{{ category.category_name | downcase }}" id="{{ category.category_name | downcase }}">
14-
<h1 class="category--title category--{{ category.category_name | downcase }}--title">{{ category.category_name }}</h1>
17+
<h2 class="category--title category--{{ category.category_name | downcase }}--title">{{ category.category_name }}</h2>
1518
<div class="grid-row">
1619
<div class="grid-col-8">
1720
<div class="category--header usa-content">
@@ -21,7 +24,7 @@ <h1 class="category--title category--{{ category.category_name | downcase }}--ti
2124
</div>
2225
</div>
2326
<div class="grid-col-4 methods-listing">
24-
<h2>Methods include</h2>
27+
<h3>Methods include</h3>
2528
<ul class="usa-list">
2629
{% for method in category.methods %}
2730
<li>

0 commit comments

Comments
 (0)