Skip to content

Commit 26e60cb

Browse files
authored
Merge branch 'main' into docs/hamburger-menu
2 parents 43d91b6 + e94cf5b commit 26e60cb

File tree

6 files changed

+30
-4
lines changed

6 files changed

+30
-4
lines changed

docs/_includes/_skip-link.njk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<a href="#main" class="skip-to-content-link">Skip to content</a>

docs/_includes/layout-basic.njk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
layout: layout-base.njk
33
---
4+
{% include '_skip-link.njk' %}
45
{% include '_nav.njk' %}
5-
<main class="basic">
6+
<main id="main" class="basic">
67
{{ content | safe }}
78
</main>
89
{% include '_foot.njk' %}

docs/_includes/layout-blog-index.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
layout: layout-base.njk
33
---
4+
{% include '_skip-link.njk' %}
45
{% include '_nav.njk' %}
56

6-
7-
<main class="basic">
7+
<main id="main"class="basic">
88
{{ content | safe }}
99

1010
<div class="posts">

docs/_includes/layout-blog.njk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
layout: layout-base.njk
33
---
4+
{% include '_skip-link.njk' %}
45
{% include '_nav.njk' %}
56

6-
<main class="blog">
7+
<main id="main" class="blog">
78
<header class="band header">
89
<h1>{{ title }}</h1>
910
{% if tagline %}<p class="tagline">{{ tagline }}</p>{% endif %}

docs/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<link rel="stylesheet" href="home.css">
99

1010
<body>
11+
<a href="#home-header" class="skip-to-content-link">Skip to content</a>
1112
{% renderFile "./docs/_snippets/pf-bar-html.md" %}
1213
<header class="band accent" id="home-header">
1314
<h1>

docs/main.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,28 @@ p:empty {
3434
display: none;
3535
}
3636

37+
.skip-to-content-link {
38+
background: var(--pf-global--BackgroundColor--100, #fff);
39+
border: 0px;
40+
border-bottom-left-radius: var(--pf-global--BorderRadius--sm, 0.25rem);
41+
border-bottom-right-radius: var(--pf-global--BorderRadius--sm, 0.25rem);
42+
display: flex;
43+
padding-inline: var(--pf-global--spacer--md, 1rem);
44+
padding-block: var(--pf-global--spacer--xs, 0.25rem);
45+
position: absolute;
46+
transform: translateY(-101%);
47+
transition: transform 0.2s;
48+
width: max-content;
49+
/* Header bar is set to z-index: 300 */
50+
z-index: 301;
51+
}
52+
53+
.skip-to-content-link:focus {
54+
transform: translateY(0%);
55+
position: fixed;
56+
top: 0;
57+
}
58+
3759
.sr-only {
3860
position: absolute;
3961
width: 1px;

0 commit comments

Comments
 (0)