-
Notifications
You must be signed in to change notification settings - Fork 566
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
Modifiers are not removed while overriding variables #1150
Comments
Offending code is somewhere in here: https://github.com/amzn/style-dictionary/blob/v4/lib/utils/deepExtend.js When deep extending objects, we don't seem to take into account that merging: {
"test": {
"value": "#ffffff",
"type": "color",
"$extensions": {
"studio.tokens": {
"modify": {
"type": "darken",
"value": ".25",
"space": "srgb"
}
}
}
}
} with {
"test": {
"value": "#ff0000",
"type": "color"
}
} should result in {
"test": {
"value": "#ff0000",
"type": "color"
}
} and not in {
"test": {
"value": "#ff0000",
"type": "color",
"$extensions": {
"studio.tokens": {
"modify": {
"type": "darken",
"value": ".25",
"space": "srgb"
}
}
}
}
} |
Hey @jorenbroekema, thank you a lot! Is V4 already ready for production? |
No its API is not yet stable, still a small amount of things coming that I think will be API breaking. It's a bit tricky to answer because V4 already solves a loooot of issues with V3 so staying on V3 might be more problematic than migrating to unstable V4 and doing another small migration to the final V4 when it releases (estimated in June) |
We have a quite huge multi theme setup - we have values for each customer/theme and semantic vars which uses modifiers:
e.g.
{ "test": { "value": "#ffffff", "type": "color", "$extensions": { "studio.tokens": { "modify": { "type": "darken", "value": ".25", "space": "srgb" } } } } }
Some of those customers/themes will override these “default-vars” afterwards e.g.:
"test": { "value": "#ff0000", "type": "color" }
Unfortunately the modifiers are not removed in this case:
The export-script uses the right color #ff000 in this case, but additionally adds the modifier.
see issue in Configurator
The text was updated successfully, but these errors were encountered: