-
Notifications
You must be signed in to change notification settings - Fork 639
chore: remove useTheme from IssueLabel #7014
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
Conversation
🦋 Changeset detectedLatest commit: 14e13aa The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
👋 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! |
…imer/react into chore/remove-usetheme-from-issuelabel
There was a problem hiding this 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 |
packages/react/src/experimental/IssueLabel/IssueLabel.module.css
Outdated
Show resolved
Hide resolved
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/4754 |
👋 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! |
👋 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! |
👋 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! |
🟢 ci completed with status |
👋 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! |
This will not work when we remove styled-system theming support, so refactoring to depend on data-color-mode attribute instead
Changelog
Changed
Rollout strategy
Testing & Reviewing
Merge checklist