tools: add "skip to content" link for screan reader and tui browsers (#12571)

pull/12567/head
Eragon 2021-11-25 01:53:02 +01:00 committed by GitHub
parent 11d70624af
commit fb3a793a27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View File

@ -37,6 +37,7 @@ const (
{{ head_assets }}
</head>
<body>
<div><a id="skip-to-content-link" href="#main-content">Skip to content</a></div>
<div id="page">
<header class="doc-nav hidden">
<div class="heading-container">
@ -59,7 +60,7 @@ const (
</ul>
</nav>
</header>
<div class="doc-scrollview">
<div class="doc-scrollview" id="main-content">
<div class="doc-container">
<div class="doc-content">
{{ contents }}

View File

@ -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;
}