web: improve screen reader usability

- switchers now have audible states
- toggles are now interpreted as toggles
- fixed weird spacing introduced in last commit
This commit is contained in:
wukko 2024-07-03 14:09:09 +06:00
parent 5ced7b5388
commit a478993599
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2
3 changed files with 4 additions and 2 deletions

View file

@ -21,6 +21,7 @@
id="setting-button-{settingContext}-{String(settingId)}-{settingValue}"
class="button"
class:active={isActive}
aria-pressed={isActive}
on:click={() =>
updateSetting({
[settingContext]: {

View file

@ -23,6 +23,7 @@
<div id="setting-toggle-{settingContext}-{String(settingId)}" class="toggle-parent">
<button
class="toggle-container"
aria-pressed={isEnabled}
on:click={() =>
updateSetting({
[settingContext]: {

View file

@ -2,7 +2,7 @@
export let big: boolean = false;
</script>
<div id="switcher-container" class="switcher" class:big={big}>
<div id="switcher-container" class="switcher" class:big={big} role="listbox">
<slot></slot>
</div>
@ -18,7 +18,7 @@
}
.switcher :global(.button) {
white-space: pre;
white-space: nowrap;
}
.switcher:not(.big) :global(.button:first-child) {