feat(emotion,ui-scripts): resolve tokens studio color modifiers and emit hex#2626
Open
HerrTopi wants to merge 2 commits into
Open
feat(emotion,ui-scripts): resolve tokens studio color modifiers and emit hex#2626HerrTopi wants to merge 2 commits into
HerrTopi wants to merge 2 commits into
Conversation
|
Visual regression report
Baselines come from the |
ToMESSKa
approved these changes
Jul 7, 2026
ToMESSKa
requested changes
Jul 8, 2026
ToMESSKa
left a comment
Contributor
There was a problem hiding this comment.
This type of override does not not work unless you change both keys (Button and IconButton) to BaseButton, but that results in not being able to override the two components separately.
<InstUISettingsProvider
themeOverride={{
components: {
Button: { primaryBackground: 'red', smallPaddingTop: '1px' },
IconButton: { primaryBackground: 'blue', secondaryBackground: 'green' }
}
}}
>
<Button color="primary">x</Button>
<IconButton color="primary">x</IconButton>
</InstUISettingsProvider>
Contributor
|
Also a similar example, this only works if both key is TreeBrowserTreeButton. Also in some cases the component key used in the InstUISettingsProvider changed:
For example here only the Palette key can be used instead of ColorMixer.Palette (v1). The question is: should my codemod I'm working on handle these key changes or should we change something in the InstUI code? |
…mit hex
Forward Tokens Studio color modifiers (`$extensions.studio.tokens.modify`) through
the theme build scripts and resolve them at theme-apply time so semantic and
component tokens can chain darken/lighten/alpha.
- generateSemantics: emit the `{ value, modify }` payload for semantic tokens and
recurse into it in resolveReferences (drop the `.value`/`.type` guard that
serialized the payload to "[object Object]").
- generateComponents: only forward `$extensions` when `studio.tokens.modify` is
present, so tokens carrying unrelated metadata no longer emit `modify: undefined`.
- applyColorModifiers: serialize the resolved color to hex (`#RRGGBBAA` when alpha
< 1, `#RRGGBB` otherwise) so modifier-derived values match every other token.
- useComputedTheme/useStyleNew/withStyleNew: resolve modifiers on semantics before
building component and shared tokens, so component-level modifiers chain on top
of already-resolved semantic values; key component overrides by the component's
own id rather than the token-source id.
- Bump @instructure/instructure-design-tokens to v1.4.0.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
a17a4e0 to
699c2d8
Compare
…component Merge the SettingsProvider component overrides with the resolved themeOverride prop and pass the result down as `themeOverride`, so nested components receive the effective overrides. Default missing overrides to an empty object to avoid merging undefined. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
699c2d8 to
c6a0526
Compare
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.

Forward Tokens Studio color modifiers (
$extensions.studio.tokens.modify) through the theme build scripts and resolve them at theme-apply time so semantic and component tokens can chain darken/lighten/alpha.{ value, modify }payload for semantic tokens and recurse into it in resolveReferences (drop the.value/.typeguard that serialized the payload to "[object Object]").$extensionswhenstudio.tokens.modifyis present, so tokens carrying unrelated metadata no longer emitmodify: undefined.#RRGGBBAAwhen alpha < 1,#RRGGBBotherwise) so modifier-derived values match every other token.🤖 Generated with Claude Code