From 0c729f248d8d6a5f789b689f6a1ed9d544ec3c3a Mon Sep 17 00:00:00 2001 From: Caleb Jasik Date: Thu, 22 Jul 2021 23:52:01 -0500 Subject: [PATCH] docs: adds a skip link so that you can skip the nav via keyboard (#829) --- docs/public/index.css | 29 +++++++++++++++++++++++++++++ docs/src/layouts/Main.astro | 1 + 2 files changed, 30 insertions(+) diff --git a/docs/public/index.css b/docs/public/index.css index f33c7c2eb..8b81cf391 100644 --- a/docs/public/index.css +++ b/docs/public/index.css @@ -433,6 +433,35 @@ h2.heading { white-space: nowrap; border-width: 0; } + +.focus\:not-sr-only:focus, +.focus\:not-sr-only:focus-visible { + position: static; + width: auto; + height: auto; + padding: 0; + margin: 0; + overflow: visible; + clip: auto; + white-space: normal; +} + +.skiplink, +.skiplink:focus, +.skiplink:focus-visible { + position: absolute; + padding: 0.25em; + font-size: larger; + top: 0.5rem; + left: 0.5rem; + z-index: 999; + display: block; + background-color: var(--theme-bg); + color: var(--theme-text-accent); + border-radius: 0.25em; + outline: var(--theme-text-accent) solid 1px; + outline-offset: 0; +} /* Screenreader Only Text - End */ :target { diff --git a/docs/src/layouts/Main.astro b/docs/src/layouts/Main.astro index 90b19dfcf..689d52d9c 100644 --- a/docs/src/layouts/Main.astro +++ b/docs/src/layouts/Main.astro @@ -256,6 +256,7 @@ if (currentPage) {
+