diff --git a/.zs/active b/.zs/active deleted file mode 100755 index f9b012c..0000000 --- a/.zs/active +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# sets the 'active' class on an item if the url matches the directory -if [ "$(dirname "$ZS_URL")" = $1 ]; then printf ' class=active' ''; fi diff --git a/.zs/aria-current b/.zs/aria-current new file mode 100755 index 0000000..53b5b91 --- /dev/null +++ b/.zs/aria-current @@ -0,0 +1,4 @@ +#!/bin/sh + +# sets the 'aria-current=page' on an anchor if the url matches the directory +if [ "$(dirname "$ZS_URL")" = $1 ]; then printf ' aria-current=%s' 'page'; fi diff --git a/.zs/layout.html b/.zs/layout.html index 1ea5f49..0d4de49 100644 --- a/.zs/layout.html +++ b/.zs/layout.html @@ -9,13 +9,13 @@ diff --git a/style.css b/style.css index d38dc80..212e4a6 100644 --- a/style.css +++ b/style.css @@ -45,17 +45,13 @@ main { menu { cursor: pointer } -.active { +a[aria-current=page] { pointer-events: none; text-decoration: underline; } #check { display: none; } -#landing.active { - display: block; -} - @media (hover: hover) { menu:hover li { visibility: inherit; @@ -81,7 +77,7 @@ menu { cursor: pointer } nav > menu > li { visibility: collapse; display: none; - &.active { + & a[aria-current=page] { visibility: inherit; display: block; } @@ -123,26 +119,26 @@ ul { } li:nth-of-type(6n + 1):hover, -li.active:nth-of-type(6n + 1) { +a[aria-current=page]:nth-of-type(6n + 1) { color: var(--red); } li:nth-of-type(6n + 2):hover, -li.active:nth-of-type(6n + 2) { +a[aria-current=page]:nth-of-type(6n + 2) { color: var(--orange); } li:nth-of-type(6n + 3):hover, -li.active:nth-of-type(6n + 3) { +a[aria-current=page]:nth-of-type(6n + 3) { color: var(--pink); } li:nth-of-type(6n + 4):hover, -li.active:nth-of-type(6n + 4) { +a[aria-current=page]:nth-of-type(6n + 4) { color: var(--green); } li:nth-of-type(6n + 5):hover, -li.active:nth-of-type(6n + 5) { +a[aria-current=page]:nth-of-type(6n + 5) { color: var(--blue); } li:nth-of-type(6n + 6):hover, -li.active:nth-of-type(6n + 6) { +a[aria-current=page]:nth-of-type(6n + 6) { color: var(--purple); }