-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Custom Properties Scoping #98
Comments
Good idea, @jakobhaerter and thanks for filling! As we have two possible solutions, which one would you prefer? Prefixing those properties with |
There is very very low risk breaking somebody code, but fixing it would give much more benefits. |
@jakobhaerter @MoritzLost you want to help out and become a first time contributor for tobii? |
@midzer @jakobhaerter @viliusle Sure, I've opened a PR for this update here: #99 The prefix approach is simpler. Scoping the variables to
I think adding prefixes is completely sufficient. The PR adds those prefixes but prefers the old custom property names, if they still exist: This way, the update is backwards compatible, so it can be a minor release. The fallback can then be dropped for the next major release. By the way, I've noticed the project lacks a changelog, so I've added one in the PR. The changelog is a good place to include update instructions and deprecation notices like this one. @midzer Let me know if you want me to remove the changelog from the PR and/or add the update instructions and deprecation notice in some other place. If you want to make this a major update right away, we can also get rid of the fallback. |
@midzer Can you create a new release with the merged PR? The latest release |
https://github.com/midzer/tobii/releases/tag/v2.4.0 is out. Let's leave this one open for an upcoming v3 when we can remove the backwards compatibility as a breaking change. |
@jakobhaerter This should probably be kept open as a reminder to drop the prefixes in 3.0.0 ;) |
@MoritzLost @midzer Yeah, my bad! 🙏 |
Naming of tobii's custom properties interferes with local custom properties due to generalized naming like
--button-background
or--button-color
, set on:root
level. A possible solution would be to scope variables inside tobii's parent node or to prefix everything, e.g.--tb-button-background
.Thanks!
The text was updated successfully, but these errors were encountered: