feat: Skip to content link
This commit is contained in:
9
sass/_main-content.scss
Normal file
9
sass/_main-content.scss
Normal file
@ -0,0 +1,9 @@
|
||||
.main-content {
|
||||
position: absolute;
|
||||
transform: translateY(-200%);
|
||||
transition: var(--transition);
|
||||
|
||||
&:focus {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
@ -44,7 +44,7 @@ body {
|
||||
|
||||
// Make focused anchor not get covered by nav,
|
||||
// and flash it with primary color when jumping to it
|
||||
:target {
|
||||
:target:not(#main) {
|
||||
scroll-margin-top: 15vh;
|
||||
animation: var(--transition-long) 1s highlight-in-out;
|
||||
color: var(--primary-color);
|
||||
|
@ -1,22 +1,21 @@
|
||||
#site-nav {
|
||||
-webkit-backdrop-filter: saturate(180%) blur(10px);
|
||||
align-items: center;
|
||||
backdrop-filter: saturate(180%) blur(10px);
|
||||
background-color: var(--nav-bg);
|
||||
border-radius: 26px;
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1),
|
||||
0px 12px 24px -16px rgba(0, 0, 0, 0.5);
|
||||
margin: 1rem auto;
|
||||
position: sticky;
|
||||
top: 1rem;
|
||||
max-width: min(calc(var(--content-width) + 10rem), 90%);
|
||||
z-index: 999;
|
||||
|
||||
nav {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 1rem auto;
|
||||
max-width: min(calc(var(--content-width) + 10rem), 90%);
|
||||
padding: 0.5rem;
|
||||
position: sticky;
|
||||
top: 1rem;
|
||||
z-index: 999;
|
||||
width: fit-content;
|
||||
|
||||
ul {
|
||||
display: flex;
|
||||
@ -85,5 +84,4 @@
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
@use "footer";
|
||||
@use "johnvertisement";
|
||||
@use "links";
|
||||
@use "main-content";
|
||||
@use "media";
|
||||
@use "nav";
|
||||
@use "not-found";
|
||||
|
@ -3,7 +3,7 @@
|
||||
{% include "includes/head.html" ignore missing -%}
|
||||
<body>
|
||||
{% include "includes/nav.html" ignore missing -%}
|
||||
<div class="container">
|
||||
<div id="main" class="container">
|
||||
{% block custom %}{%- endblock -%}
|
||||
{% block content %}{%- endblock -%}
|
||||
</div>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<header id="site-nav">
|
||||
<nav>
|
||||
<header>
|
||||
<a href="#main" class="main-content" tabindex="0">Skip to main content</a>
|
||||
<nav id="site-nav">
|
||||
<ul>
|
||||
<li id="home">
|
||||
<a href="{{ get_url(path='') }}">{{ config.title }}</a>
|
||||
|
Reference in New Issue
Block a user