Skip to content
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

Merged
merged 1 commit into from
Oct 9, 2024
Merged

Conversation

ImCoolNowRight
Copy link
Contributor

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 to theme.alpha.alpha2 and ensure it adjusts accordingly.

Checklist

  • all commented code has been removed
  • any new console issues have been resolved
  • code linter and formatter has been run
  • test coverage meets repo requirements
  • PR name matches the expected semantic-commit syntax

@ImCoolNowRight
Copy link
Contributor Author

@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?

Copy link
Contributor

@cee-money cee-money left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@erautenberg
Copy link
Contributor

@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?

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.

@ImCoolNowRight ImCoolNowRight merged commit 5823750 into develop Oct 9, 2024
8 checks passed
@ImCoolNowRight ImCoolNowRight deleted the fix/LUI-1592 branch October 9, 2024 20:10
svc-lightning-ui-components pushed a commit that referenced this pull request Oct 9, 2024
# [@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))
@svc-lightning-ui-components
Copy link
Collaborator

🎉 This PR is included in version @lightningjs/ui-components-v2.23.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants