Skip to content

Commit

Permalink
fix aria-current attr
Browse files Browse the repository at this point in the history
  • Loading branch information
jmau111 committed Aug 31, 2021
1 parent f902554 commit bb8b5e0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions assets/scss/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
}
.title-container {
margin: 0 auto;
padding: 3rem;
padding: 1.5rem;
background-color: rgba(0, 0, 0, 0.85);
border-radius: 0.5rem;
color: var(--color-subheader);
Expand Down Expand Up @@ -114,14 +114,16 @@
display: flex;
flex-wrap: nowrap;
align-items: stretch;

li + li {
margin-left: 2rem;
}
a {
color: var(--color-header);
text-transform: uppercase;
font-weight: 900;
&[aria-current="page"] {
color: var(--accent-color);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion assets/scss/_mode-dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
--color: hsl(0, 0%, 79%);
--color-header: hsl(24, 9%, 78%);
--color-menu-mobile: hsl(0, 0%, 98%);
--color-subheader: hsl(27, 17%, 77%);
--color-subheader: hsl(27, 24%, 91%);
--color-footer: hsl(27, 12%, 71%);
--color-btn: hsl(240, 3%, 7%);
--accent-color: hsl(53, 80%, 63%);
Expand Down
6 changes: 4 additions & 2 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ <h1 class="site-title slide-horizontal-invert">
<ul class="site-menu">
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
<li>
<a href="{{ .URL }}"{{ if $currentPage.IsMenuCurrent "main" . }} aria-current="page"{{ end }}>
{{ $menu_item_url := .URL | relLangURL }}
{{ $page_url:= $currentPage.RelPermalink | relLangURL }}
<li{{ if eq $menu_item_url $page_url }} class="active"{{ end }}>
<a href="{{ .URL }}"{{ if eq $menu_item_url $page_url }} aria-current="page"{{ end }}>
<span>{{ .Name }}</span>
</a>
</li>
Expand Down

0 comments on commit bb8b5e0

Please sign in to comment.