Skip to content
Merged
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
1 change: 1 addition & 0 deletions docs/_includes/_skip-link.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<a href="#main" class="skip-to-content-link">Skip to content</a>
3 changes: 2 additions & 1 deletion docs/_includes/layout-basic.njk
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
layout: layout-base.njk
---
{% include '_skip-link.njk' %}
{% include '_nav.njk' %}
<main class="basic">
<main id="main" class="basic">
{{ content | safe }}
</main>
{% include '_foot.njk' %}
4 changes: 2 additions & 2 deletions docs/_includes/layout-blog-index.njk
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
layout: layout-base.njk
---
{% include '_skip-link.njk' %}
{% include '_nav.njk' %}


<main class="basic">
<main id="main"class="basic">
{{ content | safe }}

<div class="posts">
Expand Down
3 changes: 2 additions & 1 deletion docs/_includes/layout-blog.njk
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
layout: layout-base.njk
---
{% include '_skip-link.njk' %}
{% include '_nav.njk' %}

<main class="blog">
<main id="main" class="blog">
<header class="band header">
<h1>{{ title }}</h1>
{% if tagline %}<p class="tagline">{{ tagline }}</p>{% endif %}
Expand Down
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link rel="stylesheet" href="home.css">

<body>
<a href="#home-header" class="skip-to-content-link">Skip to content</a>
{% renderFile "./docs/_snippets/pf-bar-html.md" %}
<header class="band accent" id="home-header">
<h1>
Expand Down
22 changes: 22 additions & 0 deletions docs/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,28 @@ p:empty {
display: none;
}

.skip-to-content-link {
background: var(--pf-global--BackgroundColor--100, #fff);
border: 0px;
border-bottom-left-radius: var(--pf-global--BorderRadius--sm, 0.25rem);
border-bottom-right-radius: var(--pf-global--BorderRadius--sm, 0.25rem);
display: flex;
padding-inline: var(--pf-global--spacer--md, 1rem);
padding-block: var(--pf-global--spacer--xs, 0.25rem);
position: absolute;
transform: translateY(-101%);
transition: transform 0.2s;
width: max-content;
/* Header bar is set to z-index: 300 */
z-index: 301;
}

.skip-to-content-link:focus {
transform: translateY(0%);
position: fixed;
top: 0;
}

.sr-only {
position: absolute;
width: 1px;
Expand Down