Skip to content

Commit

Permalink
Add skip-link (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
albinazs authored Sep 6, 2024
1 parent b93091c commit 0e71443
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions bakerydemo/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,18 @@ blockquote .attribute-name {
z-index: 10;
}

.skip-link {
z-index: 20;
position: absolute;
top: -100%;
padding: 20px;
background-color: var(--white);
}

.skip-link:focus {
top: 0;
}

.index-header__title {
color: var(--dark);
font-weight: 400;
Expand Down
2 changes: 1 addition & 1 deletion bakerydemo/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
{% endblock breadcrumbs %}


<main>
<main id="main-content">
{% block messages %}
{% include "includes/messages.html" %}
{% endblock messages %}
Expand Down
1 change: 1 addition & 0 deletions bakerydemo/templates/includes/header.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% load navigation_tags %}

<header class="header clearfix">
<a href="#main-content" class="skip-link">Skip to main content</a>
<div class="container">
<div class="navigation" data-navigation>
<a href="/" class="navigation__logo">The Wagtail Bakery</a>
Expand Down

0 comments on commit 0e71443

Please sign in to comment.