Correct focus style and skip link

This commit is contained in:
TheThomaas 2023-09-01 19:49:33 +02:00
parent d1691066aa
commit 836136b98c
4 changed files with 23 additions and 2 deletions

View file

@ -1 +1 @@
<a href="#main-content">Main content</a>
<a href="#main-content" class="btn">Main content</a>

View file

@ -4,6 +4,6 @@
outline-width: 2px;
}
*:focus, *:focus-visible {
*:focus:focus-visible {
outline-style: solid;
}

View file

@ -0,0 +1,20 @@
body > a {
$link-offset: .3rem;
position: absolute;
inset-block-start: $link-offset;
inset-inline-start: $link-offset;
z-index: 99999;
padding: .4rem 1rem;
&:not(:focus) {
size: 1px;
margin: -1px;
padding: 0;
white-space: nowrap;
border: 0;
clip: rect(0 0 0 0);
clip-path: inset(50%);
overflow: hidden;
}
}

View file

@ -4,6 +4,7 @@
@use './components/utilities';
@use './components/focus';
@use './components/button';
@use './components/skip-link';