Skip to content

Commit 01a6e53

Browse files
moshe742devanubis
andauthored
skip to main (#2054)
* skip to main * add the actual link * Update _style.scss * moved the id to main tag --------- Co-authored-by: Howard Cox <[email protected]>
1 parent e617459 commit 01a6e53

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

djangoproject/scss/_style.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3631,3 +3631,19 @@ ul.corporate-members li {
36313631
}
36323632
}
36333633
}
3634+
3635+
// added for skip to main functionality
3636+
.skip-link {
3637+
position: absolute;
3638+
top: -5em;
3639+
z-index: 1;
3640+
background: var(--body-bg);
3641+
color: var(--link-color);
3642+
border: 0.5em solid var(--primary);
3643+
padding: 0.5em 2em;
3644+
transition: top 0.5s ease-out;
3645+
3646+
&:focus {
3647+
top: 0;
3648+
}
3649+
}

djangoproject/templates/base.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
<body id="{% block sectionid %}generic{% endblock %}" class="{% block body_class %}{% endblock %}">
4949

50+
<a href="#main-content" class="skip-link">Skip to main content</a>
5051
{% include "includes/header.html" %}
5152

5253
<section class="copy-banner">
@@ -72,7 +73,7 @@
7273
<div id="billboard">{% block billboard %}{% endblock %}</div>
7374

7475
<div class="container {% block layout_class %}{% endblock %}">
75-
<main>
76+
<main id="main-content">
7677

7778
{% block messages %}
7879
{% if messages %}

0 commit comments

Comments
 (0)