Skip to content

Commit d059388

Browse files
committed
pref: Switch style and ARIA
1 parent e9c2359 commit d059388

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

thaw/src/switch/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ pub fn Switch(
3737

3838
style=move || css_vars.get()
3939
on:click=move |_| value.set(!value.get_untracked())
40+
role="switch"
41+
aria-checked=move || if value.get() { "true" } else { "false" }
4042
>
4143
<div class="thaw-switch__button"></div>
4244
</div>

thaw/src/switch/switch.css

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
cursor: pointer;
99
box-shadow: inset 0 0 1px 0 rgba(0, 0, 0, 0.05);
1010
transition: all 0.4s ease;
11+
user-select: none;
1112
}
1213

1314
.thaw-switch__button {

0 commit comments

Comments
 (0)