Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _includes/mixins/main_header.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<header>
<div id="sticky-header" class="menu-area">
<a href="#main-content">Skip to Content</a>
<div class="container">{% include mixins/navbar.html %}</div>
</div>
</header>
2 changes: 1 addition & 1 deletion _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
---

{% include mixins/main_header.html %}
<main>{{content}}</main>
<main id="main-content" tabindex="-1">{{content}}</main>
22 changes: 22 additions & 0 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,28 @@ Version: 1.0

/* ---------------- 0. Custom Meg Styling ---------------- */

[href="#main-content"] {
background: #03777e;
border-radius: 0 0 0.5rem;
box-shadow: 0 2px 8px rgb(0 0 0 / 30%);
color: #fff;
font-size: 1.6rem;
font-weight: bold;
padding: 1rem 2rem;
text-decoration: none;
}

/* Hide skip link when it's not focused */
[href="#main-content"]:not(:focus) {
clip: rect(0 0 0 0);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}

/* Set font for responsiveness
------------------------------
Most browsers set their default font size to 1.6rem, so if we set ours at 62.5% of that it will come out to 10px. From there, it's a lot easier to calculate rem sizing. Plus if someone changes their default browser settings, our site is coded to respond to it automatically.
Expand Down