Skip to content

Commit

Permalink
Feat: Skip Nav (#1645)
Browse files Browse the repository at this point in the history
  • Loading branch information
machikoyasuda authored Aug 14, 2023
2 parents e36324e + 43258e2 commit 035bb78
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
6 changes: 3 additions & 3 deletions benefits/core/templates/core/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
{% include "core/includes/debug.html" %}
{% endif %}
<header role="banner" id="header">
<div id="skip-to-content">
<a href="#main-content">{% translate "Skip to Main Content" %}</a>
</div>
<a id="skip-to-content" href="#main-content" class="d-block w-100">
<div class="container">{% translate "Skip to Main Content" %}</div>
</a>
{% if messages %}
{% for message in messages %}
{% include "core/includes/alert.html" with message=message %}
Expand Down
21 changes: 19 additions & 2 deletions benefits/static/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
--font-size-24px: calc(24rem / 16);
--font-size-20px: calc(20rem / 16);
--font-size-18px: calc(18rem / 16);
--font-size-15px: calc(15rem / 16);
--font-size-16px: calc(16rem / 16);
--font-size-14px: calc(14rem / 16);
--font-size-12px: calc(12rem / 16);
Expand Down Expand Up @@ -129,8 +130,8 @@ a:hover:not(.btn) {
text-decoration: underline;
}

a:focus:not(.btn):not(.card):not(.footer-link),
a:focus-visible:not(.btn):not(.card):not(.footer-link) {
a:focus:not(.btn):not(.card):not(.footer-link):not(#skip-to-content),
a:focus-visible:not(.btn):not(.card):not(.footer-link):not(#skip-to-content) {
outline: 3px solid var(--focus-color) !important;
outline-offset: 2px !important;
}
Expand Down Expand Up @@ -274,6 +275,22 @@ main {
min-height: var(--main-content-min-height);
}

#skip-to-content {
left: unset !important;
transform: none;
overflow: hidden;
background: var(--focus-color);
font-size: var(--font-size-15px);
line-height: var(--bs-body-line-height);
letter-spacing: calc(var(--font-size-15px) * var(--letter-spacing-5));
}

#skip-to-content:focus {
height: 21px !important;
outline: none !important;
box-shadow: none;
}

/* Footer */
:root {
--footer-background-color: var(--dark-color);
Expand Down

0 comments on commit 035bb78

Please sign in to comment.