-
Notifications
You must be signed in to change notification settings - Fork 410
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
css: referencing theme constants in css itself? #2709
Comments
No, the code you wrote is invalid. The Maybe your code should be something like:
See the manual page about CSS: https://www.codenameone.com/manual/css.html |
yeah, I've already been using derivation and I'm aware of theme constants being retrievable over the CN1 api, but I was curious if the constants can be used in the css itself. Derivation is an option but imho in this case the more sharing of common styles (e.g. color or image) exist the more it's turning out to an inheritance hell. |
…lla.org/en-US/docs/Web/CSS/var RFE #2709 Added sample demonstrating use of variables in project.
I have just committed support for CSS variables following the spec here. I have also added an example to the SampleRunner And I added a section to the manual describing its usage. This will be available in the next update. |
Thank you! |
In the
but when I compile I get:
The same error can be reproduced also on a new project. |
It looks like you're still using the older version. @codenameone Has da47a49 made it into the wild yet? (Commits in CodenameOneDesigner from 12 days ago). |
We pushed an update two weeks ago if I remember correctly. You made another change which still isn't there. We'll push another update soon. |
Is this currently possible? My sample below doesn't work for me (assuming that it's possible and I'm referencing the specific constant properly):
the error when recompiling:
The text was updated successfully, but these errors were encountered: