Skip to content

Conversation

francinelucca
Copy link
Member

@francinelucca francinelucca commented Oct 15, 2025

This will not work when we remove styled-system theming support, so refactoring to depend on data-color-mode attribute instead

Changelog

Changed

  • refactor IssueLabel to no use useTheme(), handle everything with css variables instead

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

Copy link

changeset-bot bot commented Oct 15, 2025

🦋 Changeset detected

Latest commit: 14e13aa

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

This PR includes changesets to release 2 packages
Name Type
@primer/react Patch
@primer/styled-react 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

@github-actions github-actions bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Oct 15, 2025
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 requested a deployment to storybook-preview-7014 October 15, 2025 18:49 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-7014 October 15, 2025 18:58 Inactive
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

Refactors IssueLabel to remove dependency on useTheme and precompute both light and dark label color CSS variables based on the provided hex color. The component now relies on data-color-mode selectors and CSS variables instead of runtime theme context.

  • Compute light and dark mode color variants in getColorsFromHex and return dual sets of CSS custom properties
  • Replace useTheme in IssueLabel with static variable generation and add CSS selectors to map mode-specific vars
  • Add changeset for patch release

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
packages/react/src/experimental/IssueLabel/getColorFromHex.ts Refactors function to drop theme params and output both light/dark CSS vars; introduces hardcoded base backgrounds
packages/react/src/experimental/IssueLabel/IssueLabel.tsx Removes useTheme and updates style merging to use new getColorsFromHex signature
packages/react/src/experimental/IssueLabel/IssueLabel.module.css Adds selectors to map light/dark mode-specific vars to generic label vars (one selector potentially too narrow)
.changeset/curly-rivers-arrive.md Declares patch release for the refactor

@primer-integration
Copy link

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

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT 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 15, 2025
Copy link
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!

@github-actions github-actions bot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Oct 16, 2025
Copy link
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!

@github-actions github-actions bot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Oct 16, 2025
Copy link
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!

@github-actions github-actions bot temporarily deployed to storybook-preview-7014 October 16, 2025 00:13 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-7014 October 16, 2025 00:21 Inactive
@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 integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh labels Oct 16, 2025
@primer-integration
Copy link

🟢 ci completed with status success.

@github-actions github-actions bot 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 16, 2025
@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 Oct 16, 2025
Copy link
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 queue Oct 16, 2025
Merged via the queue into main with commit a108ab9 Oct 16, 2025
40 of 41 checks passed
@francinelucca francinelucca deleted the chore/remove-usetheme-from-issuelabel branch October 16, 2025 15:50
@primer primer bot mentioned this pull request Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants