feat: Partial application of theme vars#391
Merged
cb-ekuersch merged 8 commits intocds-v9from Feb 12, 2026
Merged
Conversation
cb-ekuersch
commented
Feb 12, 2026
| <CodeBlock className={styles.jsonCodeBlock} language="json"> | ||
| {JSON.stringify(json, null, 2)} | ||
| </CodeBlock> | ||
| <> |
Contributor
Author
There was a problem hiding this comment.
mdx content rendered beneath this JSONCodeBlock wouldn't have any space between
04700f4 to
e5bf761
Compare
stacysun-cb
reviewed
Feb 12, 2026
| }; | ||
|
|
||
| export const ThemeProvider = ({ theme, activeColorScheme, children }: ThemeProviderProps) => { | ||
| export const ThemeProvider = memo(({ theme, activeColorScheme, children }: ThemeProviderProps) => { |
Contributor
There was a problem hiding this comment.
Curious if memo here is intentional. Since children creates a new reference, it seems like this wouldn’t prevent re-renders.
Contributor
Author
There was a problem hiding this comment.
i think this is probably an issue with all of our components that accept children, but at least here we are consistent with the optimization pattern applied to most of our components
| ); | ||
| }; | ||
| export const InvertedThemeProvider = memo( | ||
| ({ children, display, className, style }: InvertedThemeProviderProps) => { |
Contributor
There was a problem hiding this comment.
Should InvertedThemeProvider also support isolated prop?
stacysun-cb
previously approved these changes
Feb 12, 2026
Collaborator
🟡 Heimdall Review Status
🟡
|
| Code Owner | Status | Calculation | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ui-systems-eng-team |
🟡
0/1
|
Denominator calculation
|
stacysun-cb
approved these changes
Feb 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed? Why?
Original PR: #114
See the original PR for more details.
This change introduces an optimization to ThemeProvider so that in nested instances of a ThemeProvider, it will only inject new/changed theme vars into the inline styles.
This introduces a change in behavior that could affect customers who are rendering ThemeProviders in their own React DOM portals. For these customers, they must explicitly use the new
isolatedprop of the ThemeProvider.Root cause (required for bugfixes)
UI changes
Testing
How has it been tested?
Testing instructions
Illustrations/Icons Checklist
Required if this PR changes files under
packages/illustrations/**orpackages/icons/**Change management
type=routine
risk=low
impact=sev5
automerge=false