-
Notifications
You must be signed in to change notification settings - Fork 235
Open
Description
Problem Description
The focus indicators for ToggleSwitch and CheckBox currently rely on legacy shadow definitions that do not consistently utilize the design system's @focus-ring-color token.
This leads to:
- Inconsistency: These inputs look different when focused compared to Button or TextInput.
- Accessibility Gap: On certain background colors (especially in Dark Mode), the focus ring contrast ratio is below the WCAG 2.1 AA requirement of 3:1 for user interface components.
Steps to Reproduce:
- Open the Fuselage Storybook to the ToggleSwitch or CheckBox section.
- Tab through the components using the keyboard.
- Observe that the focus ring is either missing or has poor visibility compared to standard Text Inputs.
Proposed Solution:
Refactor the focus state styling in the following files to use the global focus ring token:
- packages/fuselage/src/components/ToggleSwitch/ToggleSwitch.styles.scss
- packages/fuselage/src/components/CheckBox/CheckBox.styles.scss
Instead of legacy box-shadow values, implement the standard focus ring behavior:
&:focus + .rcx-toggle-switch__fake,
&:focus + .rcx-check-box__fake {
@include focus-ring; // Or the equivalent variable/mixin used in the project
}
Impact
- Ensures the library meets modern accessibility standards (A11y).
- Reduces technical debt by migrating from hardcoded values to design tokens.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels