Improve accessibility and keyboard navigation

This commit is contained in:
Alex Shpak
2020-07-07 23:06:21 +02:00
parent f416a71bf8
commit bf93dafdfa
9 changed files with 57 additions and 23 deletions
+5 -5
View File
@@ -7,7 +7,8 @@
</head>
<body dir={{ .Site.Language.LanguageDirection }}>
<input type="checkbox" class="hidden" id="menu-control" />
<input type="checkbox" class="hidden toggle" id="menu-control" />
<input type="checkbox" class="hidden toggle" id="toc-control" />
<main class="container flex">
<aside class="book-menu">
{{ template "menu" . }} <!-- Left menu Content -->
@@ -52,10 +53,9 @@
{{ partial "docs/header" . }}
{{ if default true (default .Site.Params.BookToC .Params.BookToC) }}
<input type="checkbox" class="hidden" id="toc-control" />
<aside class="hidden clearfix">
{{ template "toc" . }}
</aside>
<aside class="hidden clearfix">
{{ template "toc" . }}
</aside>
{{ end }}
{{ end }}
+1 -1
View File
@@ -4,7 +4,7 @@
<div class="book-tabs">
{{- range $index, $tab := .Scratch.Get $group -}}
<input type="radio" class="hidden" name="{{ $group }}" id="{{ printf "%s-%d" $group $index }}" {{ if not $index }}checked="checked"{{ end }} />
<input type="radio" class="toggle" name="{{ $group }}" id="{{ printf "%s-%d" $group $index }}" {{ if not $index }}checked="checked"{{ end }} />
<label for="{{ printf "%s-%d" $group $index }}">
{{- $tab.Name -}}
</label>