From 12c6efc0fed6181db8fc728b99a5710b67c15395 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Sat, 21 Oct 2023 20:21:26 -0500 Subject: [PATCH] Add "Skip to main content" tab-focusable button - https://webaim.org/techniques/skipnav/ - https://css-tricks.com/how-to-create-a-skip-to-content-link/ --- assets/css/bobastyle.css | 16 ++++++++++++++++ layouts/_default/baseof.html | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/assets/css/bobastyle.css b/assets/css/bobastyle.css index 26488a4..d6a42a0 100644 --- a/assets/css/bobastyle.css +++ b/assets/css/bobastyle.css @@ -378,6 +378,22 @@ h1 svg.icon { } /* }}} */ +/* Skip to main content {{{ */ +#skip-to-main { + position: absolute; + padding: 8px; + background-color: var(--text-0); + color: var(--background-0); + transform: translateY(-100%); +} +#skip-to-main:focus { + transform: translateY(0%); +} +#main-content:target { + animation: none; /* prevent it from turning yellow */ +} +/* }}} */ + /* Breadcrumb navigation {{{ */ .breadcrumb { diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 1369fae..d764107 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -5,6 +5,7 @@ + Skip to main content {{ partial "icon.html" "chevron-up" }} @@ -24,7 +25,7 @@ {{ partial "breadcrumb.html" . }} {{ end }} -
+
{{ block "main" . }} THIS TEXT SHOULD NOT SHOW. YUZSIQGHE (that string is so I can grep for it) {{ end }}