Skip to content

Update Dialog/Dialog.features.stories.tsx to no longer use styled-components #6410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 28, 2025

This PR migrates the Dialog features stories away from styled-components usage as part of the broader effort to remove styled-components from the codebase for performance improvements.

Changes Made

Replaced styled-components with CSS Modules

  • Created Dialog.features.stories.module.css with CSS classes using proper CSS variables for theming
  • Replaced all Box components with standard HTML div elements
  • Replaced all Text components with sx props with standard HTML p elements
  • Converted all sx prop usage to className props referencing CSS module classes

Maintained Visual Consistency

The migration preserves the exact visual appearance by mapping styled-components theme values to their corresponding CSS variables:

  • accent.subtlevar(--bgColor-accent-muted)
  • danger.subtlevar(--bgColor-danger-muted)
  • attention.subtlevar(--bgColor-attention-muted)
  • Typography styles → var(--text-body-size-small)
  • Layout styles → CSS flexbox with proper gap values using var(--base-size-*)

Key Story Updates

  • CustomHeader: Replaced Box bg="accent.subtle" with div className={classes.CustomHeaderBg}
  • CustomBody: Wrapped Dialog.Body content in a div with danger background styling
  • CustomFooter: Wrapped Dialog.Footer content in a div with attention background styling
  • Layout containers: Replaced all flex layout Box components with semantic div elements
  • Text content: Converted all Text components to standard p elements

All functionality remains identical while completely removing styled-components dependencies from the story file.

Fixes #6409.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link

changeset-bot bot commented Jul 28, 2025

⚠️ No Changeset found

Latest commit: 86938c4

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 Dialog/Dialog.features.stories.tsx to no longer use styled-components Update Dialog/Dialog.features.stories.tsx to no longer use styled-components Jul 28, 2025
@Copilot Copilot AI requested a review from joshblack July 28, 2025 20:26
Copilot finished work on behalf of joshblack July 28, 2025 20:26
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 Dialog/Dialog.features.stories.tsx to no longer use styled-components
2 participants