Skip to content

Commit

Permalink
Add main content skip link to website (#727)
Browse files Browse the repository at this point in the history
Co-authored-by: vvveebs <[email protected]>
  • Loading branch information
neilvanbeinum and neilvanbeinum authored Mar 14, 2023
1 parent e535c9c commit 0561a33
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
14 changes: 14 additions & 0 deletions bridgetown-website/frontend/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -428,3 +428,17 @@ svg.logo .letter {
.version-text {
color: var(--sl-color-neutral-300);
}

skip-to-main-content-bar {
position: absolute;
transform: translateY(-150px);
padding: 0.7rem 0;
background-color: var(--color-lightest-orange);
display: flex;
justify-content: center;

&:focus-within {
position: static;
transform: initial;
}
}
6 changes: 5 additions & 1 deletion bridgetown-website/src/_layouts/default.serb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
{%@ "head" %}
</head>
<body class="{{ data.layout }} {{ data.page_class }}">
<skip-to-main-content-bar>
<a href="#main">Skip to main content</a>
</skip-to-main-content-bar>

<theme-picker></theme-picker>

{%@ Shared::Navbar metadata: site.metadata, resource: resource %}

<main>
<main id="main">
{%= yield %}
</main>

Expand Down

0 comments on commit 0561a33

Please sign in to comment.