Skip to content

feat(Heading): remove support for sx prop - #6860

Merged
francinelucca merged 22 commits into
mainfrom
refactor/remove-sx-from-heading
Sep 29, 2025
Merged

feat(Heading): remove support for sx prop#6860
francinelucca merged 22 commits into
mainfrom
refactor/remove-sx-from-heading

Conversation

@joshblack

Copy link
Copy Markdown
Member

Closes#6764

Changelog

New

Changed

Removed

  • Remove support for sx from Heading
  • Remove support for sx from PageHeader.Title

Rollout strategy

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

We are using the @primer/styled-react migration method for sx for this component

@joshblack
joshblack requested a review from a team as a code ownerSeptember 16, 2025 17:26
@changeset-bot

changeset-botBot commented Sep 16, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0bc1f5f

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

This PR includes changesets to release 2 packages
NameType
@primer/reactMajor
@primer/styled-reactMajor

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

@joshblackjoshblack changed the title Refactor/remove sx from headingfeat(Heading): remove support for sx propSep 16, 2025
@github-actionsgithub-actionsBot added the staff Author is a staff member label Sep 16, 2025

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 removes support for the sx prop from the Heading component and PageHeader.Title as part of the migration away from styled-components to CSS modules. The refactor introduces a styled-react compatibility layer for consumers still using the sx prop.

Key changes:

  • Remove sx prop support from the core Heading component implementation
  • Add compatibility wrapper in @primer/styled-react package for gradual migration
  • Clean up related tests, stories, and documentation that used the deprecated sx prop

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
FileDescription
packages/react/src/Heading/Heading.tsxRemove sx prop support and Box wrapper from core component
packages/styled-react/src/components/Heading.tsxAdd compatibility wrapper that preserves sx functionality via Box
packages/react/src/PageHeader/PageHeader.tsxRemove sx prop from PageHeader.Title component
packages/react/src/Heading/__tests__/Heading.test.tsxRemove tests for deprecated sx functionality
packages/react/src/Heading/Heading.features.stories.tsxRemove story demonstrating sx usage
packages/react/src/Popover/Popover.figma.tsxUpdate Figma example to remove sx usage

@github-actions

Copy link
Copy Markdown
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-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Sep 16, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6860 September 16, 2025 17:35 Inactive
@github-actions
github-actionsBot requested a deployment to storybook-preview-6860 September 22, 2025 19:39 Abandoned
@github-actions
github-actionsBot requested a deployment to storybook-preview-6860 September 22, 2025 19:48 Abandoned
@github-actionsgithub-actionsBot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Sep 22, 2025
@primer-integration

Copy link
Copy Markdown

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

@primer-integration

Copy link
Copy Markdown

🟢 ci completed with status success.

@github-actionsgithub-actionsBot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh labels Sep 24, 2025
@github-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Sep 29, 2025
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@francinelucca
francinelucca added this pull request to the merge queueSep 29, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6860 September 29, 2025 20:49 Inactive
Merged via the queue into main with commit 628e601Sep 29, 2025
42 checks passed
@francinelucca
francinelucca deleted the refactor/remove-sx-from-heading branch September 29, 2025 20:53
@primerprimerBot mentioned this pull request Sep 29, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: passingChanges in this PR do NOT cause breaking changes in gh/ghintegration-tests: recommendedThis change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpmstaffAuthor is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove support for sx from the Heading component

4 participants

@joshblack@jonrohan@francinelucca