You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As it stands the button toggles from aria-pressed="false" and aria-label="Enable dark mode" to aria-pressed="true" and aria-label="Disable dark mode" but we should not change the accessible name content.
For toggle buttons, it is important that the content doesn't change. As the button text, I have used “Toggle dark mode”. If we would update the label of the button from “Turn on light” to “Turn on dark”, we kind of have a toggle (as MDN suggests), but that way, it wouldn't be recognised by the browser and set in the accessibility tree to be a toggle, and, because of that, not announced as a toggle by screenreaders.
Resolution:
Leave the aria-label as "Toggle Dark Mode"
The text was updated successfully, but these errors were encountered:
garyb1
added a commit
to garyb1/accessible-astro-components
that referenced
this issue
Dec 6, 2023
As it stands the button toggles from
aria-pressed="false"
andaria-label="Enable dark mode"
toaria-pressed="true"
andaria-label="Disable dark mode"
but we should not change the accessible name content.References:
Resolution:
Leave the aria-label as "Toggle Dark Mode"
The text was updated successfully, but these errors were encountered: