Skip to content

Commit d04b115

Browse files
fix: checkbox layout change (#313)
* fix: checkbox layout change * fix: format
1 parent 3c12a5d commit d04b115

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

libs/components/src/checkbox/checkbox.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,20 @@
33
user-select: none;
44
}
55

6+
/**
7+
* We use visibility:hidden instead of display:none to maintain layout space and prevent height shifts.
8+
*
9+
* Per WCAG guidelines:
10+
* - visibility:hidden hides the element visually
11+
* - The indicator component already has aria-hidden="true" for explicit exclusion from accessibility tree
12+
* - This is appropriate because the indicator is purely decorative - the checkbox state
13+
* is properly communicated via the trigger's aria-checked attribute
14+
*
15+
* Sources:
16+
* - https://www.w3.org/WAI/WCAG21/Understanding/
17+
* - https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden
18+
*/
619
[data-qds-checkbox-indicator][data-hidden] {
7-
display: none;
20+
visibility: hidden;
821
}
922
}

0 commit comments

Comments
 (0)