From fb3a793a273364e58f5cf47a230e1f7f5b302044 Mon Sep 17 00:00:00 2001 From: Eragon <28783835+Eragonfr@users.noreply.github.com> Date: Thu, 25 Nov 2021 01:53:02 +0100 Subject: [PATCH] tools: add "skip to content" link for screan reader and tui browsers (#12571) --- cmd/tools/vdoc/html.v | 3 ++- cmd/tools/vdoc/resources/doc.css | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/cmd/tools/vdoc/html.v b/cmd/tools/vdoc/html.v index e5a7f32abb..b88ef4c59e 100644 --- a/cmd/tools/vdoc/html.v +++ b/cmd/tools/vdoc/html.v @@ -37,6 +37,7 @@ const ( {{ head_assets }} +
Skip to content
-
+
{{ contents }} diff --git a/cmd/tools/vdoc/resources/doc.css b/cmd/tools/vdoc/resources/doc.css index 5f7058e328..929a05c247 100644 --- a/cmd/tools/vdoc/resources/doc.css +++ b/cmd/tools/vdoc/resources/doc.css @@ -730,3 +730,19 @@ pre { top: 0; } } + +#skip-to-content-link { + height: 30px; + left: 50%; + padding: 8px; + position: absolute; + transform: translateY(-100%); + transition: transform 0.3s; + background: var(--links); + color: var(--warn-text); + border-radius: 1px; +} +#skip-to-content-link:focus { + transform: translateY(0%); + z-index: 1000; +}