Skip to content

Commit b968af6

Browse files
refactor(checkbox): sort classes, add invisible in addition to sr-only
1 parent 3f2a9ff commit b968af6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/interactive/check/Checkbox.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ export function Checkbox(p: CheckboxProps) {
2424
type="checkbox"
2525
checked={p.checked}
2626
onChange={(e) => p.onChange(e.currentTarget.checked)}
27-
class="sr-only"
27+
class="sr-only invisible"
2828
disabled={p.disabled}
2929
aria-describedby={p.id ? `${p.id}-error` : undefined}
3030
/>
3131
<div
3232
onClick={handleToggle}
3333
class={classMerge(
34-
"mt-0.5 size-6 cursor-pointer flex items-center justify-center rounded", // layout + sizing + interaction
34+
"mt-0.5 size-6", // sizing + interaction
35+
"cursor-pointer", // cursor
36+
"flex items-center justify-center", // layout children
3537
p.disabled && "cursor-not-allowed opacity-50", // disabled state
3638
)}
3739
role="checkbox"

0 commit comments

Comments
 (0)