Skip to content

Commit 7daedd8

Browse files
committed
fix: use more semantic element for page header description
Use a paragraph element instead of a div, which is a better semantic choice for a subtitle. This is a small improvement to the accessibility tree for important text elements at the top of the page.
1 parent 482597c commit 7daedd8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

blocks/page-header/page-header.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
.page-header__description,
5555
.page-header__byline {
56-
margin-block-end: 1.25rem;
56+
margin-block: 0 1.25rem;
5757

5858
@media (min-width: 48rem) {
5959
margin-block-end: 1.875rem;

blocks/page-header/page-header.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default async function decorate(block) {
2626

2727
// if there is a description, add it as an h2
2828
if (pageHeaderData.description) {
29-
const pageDescription = document.createElement("div");
29+
const pageDescription = document.createElement("p");
3030
pageDescription.classList.add("page-header__description");
3131

3232
// if there is a byline, the description uses

0 commit comments

Comments
 (0)