Skip to content

refactor(Flash): update sx usage to CSS Modules #6007

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

Merged
merged 3 commits into from
May 6, 2025

Conversation

joshblack
Copy link
Member

Update the Flash component from sx to CSS Modules. This change is not behind a feature flag since we're in the process of removing our GA flags.

Changelog

New

Changed

  • Update the sx usage of Flash internally to use CSS Modules instead

Removed

Rollout strategy

  • Minor release

@joshblack joshblack requested review from jonrohan and Copilot May 5, 2025 20:13
@joshblack joshblack requested a review from a team as a code owner May 5, 2025 20:13
Copy link

changeset-bot bot commented May 5, 2025

🦋 Changeset detected

Latest commit: 85067e1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels May 5, 2025
Copy link
Contributor

github-actions bot commented May 5, 2025

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the Flash component to use CSS Modules instead of sx and styled-components, and updates the component implementation to leverage BoxWithFallback.

  • Removed styled-components and styled-system variants
  • Added Flash.module.css with equivalent styles using CSS Modules and data attributes
  • Updated Flash.tsx to render a BoxWithFallback with CSS class and data attributes

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
packages/react/src/Flash/Flash.tsx Refactored component to use BoxWithFallback and CSS Modules, removed sx usage
packages/react/src/Flash/Flash.module.css Added CSS Module definitions for variant and layout styles
.changeset/giant-bushes-matter.md Minor release changeset noting the refactor

Copy link
Contributor

github-actions bot commented May 5, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 98.77 KB (-0.28% 🔽)
packages/react/dist/browser.umd.js 99.14 KB (+0.01% 🔺)

Copy link
Member

@jonrohan jonrohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good, just needs the CSS lint fixes

@joshblack joshblack enabled auto-merge May 6, 2025 18:37
@joshblack joshblack added this pull request to the merge queue May 6, 2025
Merged via the queue into main with commit 6e03bf9 May 6, 2025
45 checks passed
@joshblack joshblack deleted the refactor/update-flash-from-sx-to-css-modules branch May 6, 2025 19:06
@primer primer bot mentioned this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants