Skip to content

Commit

Permalink
refactor: pass lighthouse SEO audits (#261)
Browse files Browse the repository at this point in the history
* fix(header): add aria-role for theme-toggle

GoogleChrome/lighthouse#12030 (comment)

* refactor: expand switch role to sr-only elements

switch is more meaningful than button

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#technical_summary
  • Loading branch information
jamesericdavidson authored Oct 27, 2024
1 parent 60e4496 commit bf769be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
<span class="nav-icons-divider"></span>
<div class="nav-link dark-theme-toggle">
<span class="sr-only dark-theme-toggle-screen-reader-target"></span>
<a>
<a role="switch">
<span class="theme-toggle-icon" data-feather="moon"></span>
</a>
</div>

<div class="nav-link" id="hamburger-menu-toggle">
<span class="sr-only hamburger-menu-toggle-screen-reader-target">menu</span>
<a>
<a role="switch">
<span data-feather="menu"></span>
</a>
</div>
Expand All @@ -48,7 +48,7 @@
{{ end }}
<li class="nav-item dark-theme-toggle">
<span class="sr-only dark-theme-toggle-screen-reader-target">theme</span>
<a>
<a role="switch">
<span class="theme-toggle-icon" data-feather="moon"></span>
</a>
</li>
Expand Down

0 comments on commit bf769be

Please sign in to comment.