-
-
Notifications
You must be signed in to change notification settings - Fork 126
improve menu accessibility #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d1e1111
cf50bfa
ee485c2
6346f4c
fef9570
ad95b97
d275597
0ed17f0
2d152a5
b4e78ea
b6d2ffe
012f85c
476dd2a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
--- | ||
import Hamburger from "./Hamburger.astro"; | ||
import Menu from "./Menu.astro"; | ||
import Navigation from "./Navigation.astro"; | ||
import ThemeIcon from "./ThemeIcon.astro"; | ||
--- | ||
|
||
<header> | ||
<nav> | ||
<Hamburger /> | ||
<ThemeIcon /> | ||
<div> | ||
<ThemeIcon /> | ||
<Menu /> | ||
</div> | ||
<Navigation /> | ||
</nav> | ||
</header> | ||
|
||
<style> | ||
div { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
--- | ||
|
||
<button aria-expanded="false" aria-controls="main-menu" class="menu"> | ||
Menu | ||
</button> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ const identity = { | |
const skills = ["HTML", "CSS", "JavaScript", "React", "Astro", "Writing Docs"]; | ||
const skillColor = "navy"; | ||
const skillColor = "crimson"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just noting that we had a longer discussion on Discord about the fact that navy was practically imperceptible on the dark background. We updated this colour to fulfill (some admittedly arbitrary) requirements:
Reasons that we chose to sacrifice meeting accessibility requirements in dark mode:
We can even have updating this |
||
const fontWeight = "bold"; | ||
const textCase = "uppercase"; | ||
--- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
document.querySelector('.hamburger').addEventListener('click', () => { | ||
document.querySelector('.nav-links').classList.toggle('expanded'); | ||
const menu = document.querySelector('.menu') | ||
|
||
menu.addEventListener('click', () => { | ||
const isExpanded = menu.getAttribute('aria-expanded') === 'true'; | ||
menu.setAttribute('aria-expanded', !isExpanded); | ||
}); |
Uh oh!
There was an error while loading. Please reload this page.