Remove unnecessary aria-labels on theme buttons

This commit is contained in:
Jean Ducrot 2024-08-13 23:23:12 -04:00
parent 03c91b97f2
commit 6c0470bf63

View file

@ -60,9 +60,6 @@ function setPreference() {
function reflectPreference() {
document.firstElementChild.setAttribute('data-theme', theme.value);
// Let the button content set its accessible name. There is no need for an aria-label on a button with visible text.
// This practice can become a problem when the page is translated by the browser as often aria-labels are left alone
// this code would override the translated language and confuse the user
// document.querySelector('#light-theme-toggle')?.setAttribute('aria-label', lightLabel);
// document.querySelector('#dark-theme-toggle')?.setAttribute('aria-label', darkLabel);
}