Skip to content

Update Overlay.stories.tsx to no longer use styled-components #6494

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 7, 2025

This PR removes all usage of styled-components from packages/react/src/Overlay/Overlay.stories.tsx as part of the ongoing migration away from the library.

Changes Made

Removed styled-components usage:

  • Removed Box component imports and usage (4 instances)
  • Removed all sx prop usage on components (4 instances)
  • Created Overlay.stories.module.css to replace inline styles with CSS modules

CSS Module Implementation:

  • Added PascalCase class names following project standards
  • Implemented responsive design matching original width: ['350px', '500px'] behavior:
    • Default width: 350px
    • At 544px breakpoint: 500px (using correct Primer theme breakpoint)
  • Used CSS design tokens (var(--base-size-4)) for consistent spacing
  • Maintained exact same visual styling and behavior as the original implementation

Files Modified:

  • packages/react/src/Overlay/Overlay.stories.tsx - Migrated from Box components to div elements with CSS classes
  • packages/react/src/Overlay/Overlay.stories.module.css - New CSS module containing story-specific styles

Technical Details

The migration preserves all existing functionality while removing dependencies on styled-components:

  1. Container elements: Replaced <Box ref={anchorRef}> with <div ref={anchorRef} className={classes.OverlayContainer}>
  2. Full-height content: Converted complex sx props to .FullHeightContent CSS class
  3. Close button positioning: Migrated absolute positioning from sx to .CloseButtonOverlay class
  4. Responsive widths: Replaced responsive array syntax width: ['350px', '500px'] with CSS media queries that correctly implement the mobile-first responsive behavior

All tests pass and Storybook builds successfully with these changes.

Fixes #6493.


💬 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 7, 2025

⚠️ No Changeset found

Latest commit: 552cb63

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 Overlay.stories.tsx to no longer use styled-components Update Overlay.stories.tsx to no longer use styled-components Aug 7, 2025
@Copilot Copilot AI requested a review from hectahertz August 7, 2025 17:32
Copilot finished work on behalf of hectahertz August 7, 2025 17:32
@hectahertz hectahertz marked this pull request as ready for review August 7, 2025 18:45
@Copilot Copilot AI review requested due to automatic review settings August 7, 2025 18:45
@hectahertz hectahertz requested a review from a team as a code owner August 7, 2025 18:45
@hectahertz hectahertz requested a review from jonrohan August 7, 2025 18:45
@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Aug 7, 2025
Copy link
Contributor

github-actions bot commented Aug 7, 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 migrates the Overlay stories from styled-components to CSS modules, removing all Box component usage and sx prop styling as part of the project's ongoing migration away from styled-components.

  • Replaced Box components with div elements using CSS module classes
  • Created CSS module file with equivalent styling using design tokens and media queries
  • Maintained all existing visual styling and behavior while removing styled-components dependencies

Reviewed Changes

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

File Description
packages/react/src/Overlay/Overlay.stories.tsx Replaced Box components and sx props with div elements and CSS module classes
packages/react/src/Overlay/Overlay.stories.module.css New CSS module containing story-specific styles with design tokens and responsive breakpoints

Copy link
Contributor

github-actions bot commented Aug 7, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 90.2 KB (0%)
packages/react/dist/browser.umd.js 90.38 KB (0%)

@hectahertz hectahertz added the skip changeset This change does not need a changelog label Aug 7, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-6494 August 7, 2025 18:55 Inactive
@hectahertz hectahertz enabled auto-merge August 7, 2025 18:56
@github-actions github-actions bot requested a deployment to storybook-preview-6494 August 7, 2025 18:58 Abandoned
@github-actions github-actions bot requested a deployment to storybook-preview-6494 August 7, 2025 19:03 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-6494 August 7, 2025 19:12 Inactive
auto-merge was automatically disabled August 7, 2025 19:13

Head branch was pushed to by a user without write access

Copilot finished work on behalf of hectahertz August 7, 2025 19:17
@Copilot Copilot AI requested a review from hectahertz August 7, 2025 19:17
@hectahertz hectahertz enabled auto-merge August 12, 2025 16:34
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 skip changeset This change does not need a changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Overlay.stories.tsx to no longer use styled-components
3 participants