-
Notifications
You must be signed in to change notification settings - Fork 23
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(Colors): enable [token, newAlpha] format #543
Conversation
@erautenberg Regarding this change from #499 and whether it should be adjusted in this PR, I just want to make sure that you agree that we should only be allowing this format to work within style files and that there's no expectation of this ever coming from the theme and we don't need to adjust those conditionals, correct? |
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
Yep, I think that makes total sense. In the context of the original theme, you could always reference just the first value of another token instead of the entire thing, so there are clear workarounds from that level. |
# [@lightningjs/ui-components-v2.23.3](https://github.com/rdkcentral/Lightning-UI-Components/compare/@lightningjs/ui-components-v2.23.2...@lightningjs/ui-components-v2.23.3) (2024-10-09) ### Bug Fixes * **Colors:** enable [token, newAlpha] format ([#543](#543)) ([5823750](5823750))
🎉 This PR is included in version @lightningjs/ui-components-v2.23.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Enables users to set colors using the format
[colorToken, newAlpha]
so that an existing color token can be utilized and just have its alpha value overridden.This was doable prior to #499, but was only used in a few fringe cases. This PR enables that again while maintaining the functionality added in the previous PR.
References
LUI-1592
Testing
Set the
backgroundColor
in Surface.styles.js to be[theme.color.interactiveNeutral, theme.alpha.alpha1]
. This should no longer cause the component to render in pure white. Change the second value totheme.alpha.alpha2
and ensure it adjusts accordingly.Checklist