1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-29 15:11:58 +00:00

fix(web): announce current theme to screen reader users (#12039)

This commit is contained in:
Ben 2024-08-25 19:50:54 -04:00 committed by GitHub
parent b2dd5a3152
commit 96056208fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View file

@ -7,8 +7,16 @@
$: icon = $colorTheme.value === Theme.LIGHT ? moonPath : sunPath;
$: viewBox = $colorTheme.value === Theme.LIGHT ? moonViewBox : sunViewBox;
$: isDark = $colorTheme.value === Theme.DARK;
</script>
{#if !$colorTheme.system}
<CircleIconButton title={$t('toggle_theme')} {icon} {viewBox} on:click={handleToggleTheme} />
<CircleIconButton
title={$t('toggle_theme')}
{icon}
{viewBox}
role="switch"
aria-checked={isDark ? 'true' : 'false'}
on:click={handleToggleTheme}
/>
{/if}

View file

@ -1171,7 +1171,7 @@
"to_login": "Login",
"to_trash": "Trash",
"toggle_settings": "Toggle settings",
"toggle_theme": "Toggle theme",
"toggle_theme": "Toggle dark theme",
"total_usage": "Total usage",
"trash": "Trash",
"trash_all": "Trash All",