Skip to content

Commit 0e71443

Browse files
authored
Add skip-link (wagtail#504)
1 parent b93091c commit 0e71443

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

bakerydemo/static/css/main.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,18 @@ blockquote .attribute-name {
455455
z-index: 10;
456456
}
457457

458+
.skip-link {
459+
z-index: 20;
460+
position: absolute;
461+
top: -100%;
462+
padding: 20px;
463+
background-color: var(--white);
464+
}
465+
466+
.skip-link:focus {
467+
top: 0;
468+
}
469+
458470
.index-header__title {
459471
color: var(--dark);
460472
font-weight: 400;

bakerydemo/templates/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
{% endblock breadcrumbs %}
4242

4343

44-
<main>
44+
<main id="main-content">
4545
{% block messages %}
4646
{% include "includes/messages.html" %}
4747
{% endblock messages %}

bakerydemo/templates/includes/header.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% load navigation_tags %}
22

33
<header class="header clearfix">
4+
<a href="#main-content" class="skip-link">Skip to main content</a>
45
<div class="container">
56
<div class="navigation" data-navigation>
67
<a href="/" class="navigation__logo">The Wagtail Bakery</a>

0 commit comments

Comments
 (0)