Skip to content

Remove Box usage and sx prop from PageLayout - #6942

Merged
francinelucca merged 6 commits into
mainfrom
revert-6940-chore/revert-6872
Oct 6, 2025
Merged

Remove Box usage and sx prop from PageLayout#6942
francinelucca merged 6 commits into
mainfrom
revert-6940-chore/revert-6872

Conversation

@francinelucca

@francineluccafrancinelucca commented Oct 3, 2025

Copy link
Copy Markdown
Member

Reintroduces #6872 but without PageHeader and PageFooter styled wrappers (not needed and doesn't play well with slots)

@changeset-bot

changeset-botBot commented Oct 3, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fca3c90

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

@github-actionsgithub-actionsBot added the staff Author is a staff member label Oct 3, 2025
@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 Oct 3, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6942 October 3, 2025 16:00 Inactive
@primer-integration

Copy link
Copy Markdown

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

@github-actionsgithub-actionsBot 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 Oct 6, 2025
@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 Oct 6, 2025
@francinelucca
francinelucca marked this pull request as ready for review October 6, 2025 19:29
@francinelucca
francinelucca requested a review from a team as a code ownerOctober 6, 2025 19:29

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 Box component usage and the sx prop from PageLayout components in favor of native HTML elements and CSS classes. This continues the migration away from styled-components in the Primer Design System's React implementation while maintaining backward compatibility through the styled-react wrapper package.

Key changes:

  • Replace Box/BoxWithFallback components with native HTML elements (div, header, footer)
  • Remove sx prop support from all PageLayout subcomponents
  • Add CSS classes for styling previously handled by sx props
  • Update styled-react package to provide sx prop compatibility layer

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
packages/styled-react/src/index.tsxUpdates export to use local PageLayout implementation instead of re-exporting from @primer/react
packages/styled-react/src/components/PageLayout.tsxAdds styled wrapper components that preserve sx prop functionality for backward compatibility
packages/styled-react/src/tests/primer-react.browser.test.tsxRemoves tests for Header and Footer sx prop support (now handled by styled wrappers)
packages/react/src/PageLayout/PageLayout.tsxReplaces Box components with native HTML elements and removes sx prop from all interfaces
packages/react/src/PageLayout/PageLayout.stories.tsxRemoves sx prop usage from story template
packages/react/src/PageLayout/PageLayout.module.cssAdds CSS classes for draggable handle styling previously handled by sx props
packages/react/src/PageLayout/PageLayout.dev.stories.tsxReplaces sx prop usage with CSS class names for debug styling
packages/react/src/PageLayout/PageLayout.dev.stories.module.cssAdds CSS classes for debug styling previously handled by sx props
.changeset/gold-geckos-send.mdDocuments breaking change for sx prop removal

Comment threadpackages/styled-react/src/components/PageLayout.tsx
@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 Oct 6, 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!

@llastflowersllastflowers 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.

@francinelucca
francinelucca added this pull request to the merge queueOct 6, 2025
@francinelucca

Copy link
Copy Markdown
MemberAuthor

@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 Oct 6, 2025
@github-merge-queue
github-merge-queueBot removed this pull request from the merge queue due to failed status checks Oct 6, 2025
@francinelucca
francinelucca added this pull request to the merge queueOct 6, 2025
Merged via the queue into main with commit 3ced917Oct 6, 2025
42 checks passed
@francinelucca
francinelucca deleted the revert-6940-chore/revert-6872 branch October 6, 2025 23:19
@primerprimerBot mentioned this pull request Oct 6, 2025
llastflowers pushed a commit that referenced this pull request Oct 6, 2025
Co-authored-by: Mike Perrotti <mperrotti@github.com>
pksjce pushed a commit that referenced this pull request Oct 7, 2025
Co-authored-by: Mike Perrotti <mperrotti@github.com>
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/ghstaffAuthor is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@francinelucca@mperrotti@llastflowers