mirror of
https://github.com/kogakure/website-astro-stefanimhoff.de.git
synced 2026-02-03 12:05:28 +00:00
feat(a11y): add aria-current to navigation
This commit is contained in:
@@ -10,8 +10,10 @@
|
|||||||
links.forEach((link) => {
|
links.forEach((link) => {
|
||||||
if (link.getAttribute('href') === currentPath) {
|
if (link.getAttribute('href') === currentPath) {
|
||||||
link.classList.add('is-active');
|
link.classList.add('is-active');
|
||||||
|
link.setAttribute('aria-current', 'page');
|
||||||
} else {
|
} else {
|
||||||
link.classList.remove('is-active');
|
link.classList.remove('is-active');
|
||||||
|
link.removeAttribute('aria-current');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user