Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 11, 2025

This PR migrates the BaseStyles.dev.stories.tsx file from using styled-components to CSS modules as part of the project's effort to move away from styled-components.

Changes Made

  • Removed BaseStyles component usage from all stories and replaced with plain <div> elements
  • Created BaseStyles.dev.stories.module.css with CSS classes that replicate the exact styling behavior of the original sx and system props
  • Updated imports to include clsx for combining CSS classes and the new CSS module
  • Migrated stories:
    • WithSxProps: Now uses CSS class instead of sx prop
    • WithSystemProps: Now uses CSS class instead of system props like color, backgroundColor, etc.
    • WithStyleProps: Already used inline styles, no changes needed
    • Default: No changes needed (returns plain text)

Visual Verification

All stories maintain their exact visual appearance:

Story Screenshot
WithSxProps WithSxProps
WithSystemProps WithSystemProps
WithStyleProps WithStyleProps

The migration demonstrates the pattern for replacing styled-components usage with CSS modules while maintaining identical visual output. All styling properties (red text, blue background, Arial font, line-height, font-size, display flex) are preserved using CSS classes instead of runtime styled-components.

Technical Details

  • Uses clsx for conditional class application as per project standards
  • Added appropriate stylelint disable comments for demo-specific colors and fonts
  • No changes to source components - migration is isolated to story files only
  • All tests pass and build succeeds

Fixes #6575.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link

changeset-bot bot commented Aug 11, 2025

⚠️ No Changeset found

Latest commit: 853cdd1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Copilot Copilot AI changed the title [WIP] Update BaseStyles.dev.stories.tsx to no longer use styled-components Update BaseStyles.dev.stories.tsx to no longer use styled-components Aug 11, 2025
Copilot finished work on behalf of hectahertz August 11, 2025 17:09
@Copilot Copilot AI requested a review from hectahertz August 11, 2025 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update BaseStyles.dev.stories.tsx to no longer use styled-components
2 participants