Make use of aria-current as selector and remove use of active class.
This commit is contained in:
parent
9bdec6ca76
commit
93728f1e9e
5 changed files with 17 additions and 15 deletions
|
|
@ -196,17 +196,13 @@ figure {
|
|||
}
|
||||
|
||||
&:active,
|
||||
&.active {
|
||||
&[aria-current] {
|
||||
background-color: var(--color-brand);
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.menu a.active {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
// Search
|
||||
|
||||
.search-text {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,12 @@ a:active {
|
|||
color: var(--color-link-active);
|
||||
}
|
||||
|
||||
// Remove underline from links to current page to
|
||||
// indicate that there is no need to click on it.
|
||||
[aria-current] {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.link-nav,
|
||||
%link-nav {
|
||||
a {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
{{ $currentPage := . -}}
|
||||
{{ range site.Menus.main -}}
|
||||
<li><a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} class="active" aria-current="page"{{ end }}>{{ .Pre }}<span>{{ .Name }}</span>{{ .Post }}</a></li>
|
||||
<li><a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} aria-current="page"{{ end }}>{{ .Pre }}<span>{{ .Name }}</span>{{ .Post }}</a></li>
|
||||
{{ end -}}
|
||||
|
||||
{{ else -}}
|
||||
|
|
@ -12,12 +12,12 @@
|
|||
{{ $currentSection := .Section -}}
|
||||
{{ $currentID := "" -}}
|
||||
{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}
|
||||
{{ with site.Home }}<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ i18n "menu_home" }}</a></li>{{ end }}
|
||||
{{ with site.Home }}<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ i18n "menu_home" }}</a></li>{{ end }}
|
||||
{{ range where site.RegularPages "Section" "" -}}
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
{{ range site.Sections -}}
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
|
||||
{{ end -}}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
{{ $currentPage := . -}}
|
||||
{{ range site.Menus.main -}}
|
||||
<li><a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} class="active" aria-current="page"{{ end }}>{{ .Pre }}<span>{{ .Name }}</span>{{ .Post }}</a></li>
|
||||
<li><a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} aria-current="page"{{ end }}>{{ .Pre }}<span>{{ .Name }}</span>{{ .Post }}</a></li>
|
||||
{{ end -}}
|
||||
|
||||
{{ else -}}
|
||||
|
|
@ -24,12 +24,12 @@
|
|||
{{ $currentSection := .Section -}}
|
||||
{{ $currentID := "" -}}
|
||||
{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}
|
||||
{{ with site.Home }}<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ i18n "menu_home" }}</a></li>{{ end }}
|
||||
{{ with site.Home }}<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ i18n "menu_home" }}</a></li>{{ end }}
|
||||
{{ range where site.RegularPages "Section" "" -}}
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
{{ range site.Sections -}}
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
|
||||
{{ end -}}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
<aside class="sidebar layout__second-sidebar">
|
||||
{{ range site.Sections -}}
|
||||
<section class="menu">
|
||||
<p class="title"><strong><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></strong></p>
|
||||
<p class="title"><strong><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} aria-current="page"{{ end }}>{{ .Title }}</a></strong></p>
|
||||
<ul>
|
||||
{{ range .Pages -}}
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
</section>
|
||||
|
|
|
|||
Loading…
Reference in a new issue