Skip to content

Conversation

@siddharthkp
Copy link
Member

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; only updated examples

Testing & Reviewing

Merge checklist

@siddharthkp siddharthkp self-assigned this Oct 28, 2025
@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2025

⚠️ No Changeset found

Latest commit: fd4f9c6

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

@siddharthkp siddharthkp added the skip changeset This change does not need a changelog label Oct 28, 2025
@github-actions github-actions bot added the staff Author is a staff member label Oct 28, 2025
@siddharthkp siddharthkp marked this pull request as ready for review October 28, 2025 21:21
@siddharthkp siddharthkp requested a review from a team as a code owner October 28, 2025 21:21
Copy link
Contributor

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 Next.js example from using the legacy @primer/styled-react package to the modern @primer/react package, removing the styled-components dependency entirely.

Key changes:

  • Removed @primer/styled-react and styled-components dependencies from package.json
  • Updated imports from @primer/styled-react to @primer/react for ThemeProvider and BaseStyles
  • Simplified the example by removing styled-components registry and custom styled components

Reviewed Changes

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

Show a summary per file
File Description
package-lock.json Removed @primer/styled-react and styled-components from the Next.js example workspace
examples/nextjs/package.json Removed @primer/styled-react and styled-components dependencies
examples/nextjs/src/app/registry.tsx Deleted the entire styled-components registry file (no longer needed)
examples/nextjs/src/app/layout.tsx Updated to import from @primer/react and removed StyledComponentsRegistry wrapper
examples/nextjs/src/app/page.tsx Simplified example to use only @primer/react Button, removing styled-components usage
examples/nextjs/src/app/global.css Removed body styling that is now handled by BaseStyles component

Comment on lines 1 to 3
@import '@primer/primitives/dist/css/primitives.css';
@import '@primer/primitives/dist/css/functional/themes/light.css';
@import '@primer/primitives/dist/css/functional/themes/dark.css';
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the body styles (color and background-color) appears intentional since these are now handled by the BaseStyles component in layout.tsx. However, there's no comment explaining this dependency. Consider adding a comment in this file explaining that body styles are managed by the BaseStyles component to prevent confusion if someone tries to add them back.

See below for a potential fix:

@ -1,3 +1,8 @@
/* 
 * Note: Body styles for `color` and `background-color` are intentionally omitted here.
 * These are managed by the BaseStyles component in layout.tsx.
 * Do not add body color/background-color styles in this file.
 */

Copilot uses AI. Check for mistakes.
Comment on lines -5 to -8
body {
color: var(--fgColor-default);
background-color: var(--bgColor-default);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still need these on body since BaseStyles only adds them to the root of that component, right? Or is that not the case anymore 👀

Copy link
Member Author

@siddharthkp siddharthkp Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure these styles never worked because the variables are not defined if data-color-mode is not present on <html> or <body> 🙃

BaseStyles only adds them to the root of that component

That is still correct

Eventually, it would make sense for us to offer a way to have ThemeProvider set data-color-mode on <html> instead on the div rendered by ThemeProvider or BaseStyles

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair 😂 lol, those attributes definitely need to be there 😰

@siddharthkp siddharthkp added this pull request to the merge queue Oct 30, 2025
Merged via the queue into main with commit 953315c Oct 30, 2025
54 of 55 checks passed
@siddharthkp siddharthkp deleted the examples/nextjs-use-primer-react-theming branch October 30, 2025 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changeset This change does not need a changelog staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants