Remove styled-components from CheckboxGroup.dev.stories.tsx #6594
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes styled-components usage from
CheckboxGroup.dev.stories.tsx
by migrating from thesx
prop to CSS modules, following the established migration pattern used in other components.Changes Made
sx
prop usage: Convertedsx
styles onCheckboxGroup
,CheckboxGroup.Caption
, andCheckboxGroup.Label
to CSS classesCheckboxGroup.dev.module.css
: Added CSS module with equivalent styles using CSS custom properties for design tokenssx
from excluded controls since it's no longer usedSxProps
toWithCss
to reflect the new CSS-based approachTechnical Details
The migration preserves all original styling:
All styles now use CSS custom properties (e.g.,
var(--fgColor-default)
,var(--base-size-16)
) to maintain consistency with the design system.Visual Verification
The CheckboxGroup dev story continues to display correctly with identical visual appearance, now using CSS modules instead of styled-components.
This change contributes to the ongoing migration away from styled-components in the Primer React codebase, improving performance and reducing bundle size.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.