-
Notifications
You must be signed in to change notification settings - Fork 625
Migrate Overlay.dev.stories.tsx from styled-components to CSS modules #6498
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
base: main
Are you sure you want to change the base?
Conversation
|
Co-authored-by: hectahertz <[email protected]>
There was a problem hiding this 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 migrates Overlay.dev.stories.tsx
from styled-components to CSS modules as part of the broader effort to remove styled-components dependencies from the design system. The migration replaces all Box
components with standard div
elements and converts sx
prop styling to CSS module classes while preserving existing visual behavior and functionality.
Key changes:
- Replaced all
Box
components withdiv
elements and CSS module classes - Created
Overlay.dev.stories.module.css
with equivalent styles using Primer design tokens - Migrated responsive styling and component positioning to CSS modules
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
packages/react/src/Overlay/Overlay.dev.stories.tsx |
Removed Box imports and sx props, replaced with div elements and CSS module classes |
packages/react/src/Overlay/Overlay.dev.stories.module.css |
Added CSS module with equivalent styles using Primer design tokens and responsive breakpoints |
👋 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! |
size-limit report 📦
|
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
@@ -0,0 +1,56 @@ | |||
/* CSS Module for Overlay dev stories */ | |||
|
|||
.AnchorContainer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Please delete these lines and the references to this class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! I've removed the unused .AnchorContainer
CSS class and its comment, as well as its usage from both story functions. Also fixed the color variable to use the proper foreground color. Commit: 72152fd
Co-authored-by: hectahertz <[email protected]>
Head branch was pushed to by a user without write access
|
||
.OverlayCustom { | ||
left: 50%; | ||
margin-top: var(--base-size-8); /* mt: 2 equivalent */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot No need for that comment :) Can you remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the unnecessary comment. Commit: 39447a8
margin-top: var(--base-size-8); /* mt: 2 equivalent */ | ||
} | ||
|
||
.ButtonRight { | ||
margin-right: var(--base-size-4); /* marginRight: 1 equivalent */ | ||
} | ||
|
||
.ButtonLeft { | ||
margin-left: var(--base-size-4); /* marginLeft: 1 equivalent */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
margin-top: var(--base-size-8); /* mt: 2 equivalent */ | |
} | |
.ButtonRight { | |
margin-right: var(--base-size-4); /* marginRight: 1 equivalent */ | |
} | |
.ButtonLeft { | |
margin-left: var(--base-size-4); /* marginLeft: 1 equivalent */ | |
margin-top: var(--base-size-8); | |
} | |
.ButtonRight { | |
margin-right: var(--base-size-4); | |
} | |
.ButtonLeft { | |
margin-left: var(--base-size-4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Remove comments like these please :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the remaining descriptive comments from the CSS module as requested. Kept only the functional stylelint disable comments that are required for linting rules. Commit: 7dcc468
Co-authored-by: hectahertz <[email protected]>
Head branch was pushed to by a user without write access
Co-authored-by: hectahertz <[email protected]>
This PR migrates
packages/react/src/Overlay/Overlay.dev.stories.tsx
away from styled-components usage as part of our ongoing effort to remove dependencies on the styled-components library.Changes Made
Removed styled-components dependencies:
Box
components with standarddiv
elementssx
prop styles to CSS module classesdisplay
,flexDirection
,alignItems
to CSS classesAdded CSS modules:
Overlay.dev.stories.module.css
with equivalent styles using Primer design tokensvar(--base-size-*)
,var(--fgColor-danger)
)Key migrations:
Testing
The stories continue to work identically with the same visual appearance and interactive behavior, but now use CSS modules instead of styled-components for styling.
Fixes #6497.
💡 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.