-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(component-tokens): only emit static values in emit-component-tokens #7801
Conversation
Deploy preview for carbon-elements ready! Built with commit ac30e17 |
Deploy preview for carbon-components-react ready! Built without sensitive environment variables with commit ac30e17 https://deploy-preview-7801--carbon-components-react.netlify.app |
@janhassel would we want this to be the default behavior (forcing static values)? This specific mixin is private IIRC so we can totally update it if it should be that behavior by default. |
@joshblack I was thinking since the mixin is called far more often without the carbon/packages/components/src/components/tag/_tag.scss Lines 48 to 126 in 1de98d0
Open to change it though if you think it makes more sens to have the default set as |
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.
LGTM 👍 ✅
Closes #7800
The
emit-component-tokens
mixin currently emits all tokens as css custom properties if the feature flag is enabled, resulting in the actual css variable never declared and the colors always falling back to the default, white theme.The workaround so far was to include the component's styles again, like so:
This results in a lot of unnecessary css being generated and can create specificity issues.
Changelog
New
$force-static-values
toget-token-value
mixin.Changed
true
to$force-static-values
fromemit-component-tokens
mixin.Testing / Reviewing
Before, this code should not result in the correct tag colors:
With the changes in this PR, it should result in the correct tag colors.
In the inspector, all tag colors should be shown as static values:
compared to before