hackertours-theme/layouts/_partials/mobilemenu.html
Fredrik Jonsson 16c47eea9d
Using color-scheme and light-dark() to implement dark mode (#154)
* Lint fixes.

* Implement light-dark().

* Lint css with biome, remove stylelint.

* Biome lint fixes.

* Dark mode adjustments.

* Style bug fixes.

* Colour adjustments.

* Move header and footer styles to base.

* Site header adjustments.

* Removing jQuery and umbrella libs. They where great but not needed anymore.

* Add colorScheme to optionally lock light/dark.

* Update README.

* Biome adjustments.
2026-05-28 08:18:04 +02:00

22 lines
1.2 KiB
HTML

<div class="mobile-nav" dir="ltr" hidden>
<div class="mobile-nav__cover"></div>
<button class="mobile-nav__toggle button{{ if $.Param "mobilemenuoutline" }} button--outline{{ end }}" aria-expanded="false" aria-controls="sheet">
{{ i18n "menu_mobile" }}
<svg class="mobile-nav__hamburger" viewBox="0 0 100 100" focusable="false" aria-hidden="true">
<rect width="80" height="12" x="10" y="20" rx="5"></rect>
<rect width="80" height="12" x="10" y="45" rx="5"></rect>
<rect width="80" height="12" x="10" y="70" rx="5"></rect>
</svg>
</button>
<div class="mobile-nav__sheet link-nav" id="sheet" data-theme="dark" aria-hidden="true">
<div class="mobile-nav__region">{{ if hugo.IsMultilingual }}{{ partial "language-selector.html" . }}{{ end }}</div>
<nav class="mobile-nav__main-menu" aria-label="{{ i18n "menu_title" }}">
<ul class="mobile-nav__navbar">
{{ $currentPage := . -}}
{{ range site.Menus.main -}}
<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 -}}
</ul>
</nav>
</div>
</div>