mirror of
https://github.com/imputnet/cobalt.git
synced 2025-01-01 12:46:07 +00:00
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:
parent
5ced7b5388
commit
a478993599
|
@ -21,6 +21,7 @@
|
||||||
id="setting-button-{settingContext}-{String(settingId)}-{settingValue}"
|
id="setting-button-{settingContext}-{String(settingId)}-{settingValue}"
|
||||||
class="button"
|
class="button"
|
||||||
class:active={isActive}
|
class:active={isActive}
|
||||||
|
aria-pressed={isActive}
|
||||||
on:click={() =>
|
on:click={() =>
|
||||||
updateSetting({
|
updateSetting({
|
||||||
[settingContext]: {
|
[settingContext]: {
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
<div id="setting-toggle-{settingContext}-{String(settingId)}" class="toggle-parent">
|
<div id="setting-toggle-{settingContext}-{String(settingId)}" class="toggle-parent">
|
||||||
<button
|
<button
|
||||||
class="toggle-container"
|
class="toggle-container"
|
||||||
|
aria-pressed={isEnabled}
|
||||||
on:click={() =>
|
on:click={() =>
|
||||||
updateSetting({
|
updateSetting({
|
||||||
[settingContext]: {
|
[settingContext]: {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
export let big: boolean = false;
|
export let big: boolean = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="switcher-container" class="switcher" class:big={big}>
|
<div id="switcher-container" class="switcher" class:big={big} role="listbox">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.switcher :global(.button) {
|
.switcher :global(.button) {
|
||||||
white-space: pre;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.switcher:not(.big) :global(.button:first-child) {
|
.switcher:not(.big) :global(.button:first-child) {
|
||||||
|
|
Loading…
Reference in a new issue