Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion assets/critical.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ body {
calc(100% - var(--page-margin) * 2)
);
--content-margin: minmax(var(--page-margin), 1fr);
--content-grid: var(--content-margin) var(--content-width) var(--content-margin);
--content-grid: var(--content-margin) var(--content-width)
var(--content-margin);

/* This is required to make <img> elements work as background images */
position: relative;
Expand All @@ -115,3 +116,13 @@ body {
.shopify-section > .full-width {
grid-column: 1 / -1;
}

/* Visually hide content while keeping it available in the accessibility tree. */
.visually-hidden:not(:focus):not(:active) {
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}
4 changes: 3 additions & 1 deletion layout/theme.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
<body>
{% sections 'header-group' %}

{{ content_for_layout }}
<main id="main" tabindex="-1">
{{ content_for_layout }}
</main>

{% sections 'footer-group' %}
</body>
Expand Down
3 changes: 3 additions & 0 deletions locales/en.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"collections": {
"title": "Collections"
},
"general": {
"skip_link": "Skip to main content"
},
"gift_card": {
"add_to_apple_wallet": "Add to Apple Wallet",
"card": "Gift card",
Expand Down
12 changes: 12 additions & 0 deletions sections/header.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<header>
<a href="#main" class="skip-link visually-hidden">
{{ 'general.skip_link' | t }}
</a>

<h2 class="header__title">
{{ shop.name | link_to: routes.root_url }}
</h2>
Expand Down Expand Up @@ -55,6 +59,14 @@
display: flex;
gap: 1rem;
}

header .skip-link {
position: absolute;
top: 0;
left: 0;
padding: var(--page-margin);
background-color: var(--color-background);
}
{% endstylesheet %}

{% schema %}
Expand Down
Loading