Skip to content

Remove sx prop support from ToggleSwitch #6627

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 7 commits into
base: main
Choose a base branch
from

Conversation

liuliu-dev
Copy link
Contributor

@liuliu-dev liuliu-dev commented Aug 19, 2025

Migrates the ToggleSwitch component away from Box components and sx prop support to use CSS modules, closes #4826

What Changed

  • Removed Box wrapper and sx prop support from the main ToggleSwitch component

  • Replaced sx prop styling with CSS modules and data attributes for state-based styling

  • Added ToggleSwitch to the styled-react package for repos still using sx props

  • Note: SwitchButton and ToggleKnob still use styled-components (styled.button and styled.div) and will be migrated in a future iteration

Rollout strategy

  • Major release; if selected, include a written rollout or migration plan

Copy link

changeset-bot bot commented Aug 19, 2025

🦋 Changeset detected

Latest commit: 81b9da0

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

This PR includes changesets to release 3 packages
Name Type
@primer/react Major
@primer/styled-react Major
@primer/mcp Patch

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

Copy link
Contributor

👋 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!

@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 19, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-6627 August 19, 2025 23:09 Inactive
Copy link
Contributor

github-actions bot commented Aug 19, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 90.17 KB (-0.13% 🔽)
packages/react/dist/browser.umd.js 90.41 KB (-0.05% 🔽)

@github-actions github-actions bot requested a deployment to storybook-preview-6627 August 20, 2025 00:09 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-6627 August 20, 2025 00:20 Inactive
@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/397774

@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Aug 20, 2025
@primer-integration
Copy link

🔴 golden-jobs completed with status failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: failing Changes in this PR cause breaking changes in gh/gh
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant