Support for CSS declared variables in perspective style classes?

Seems likes perspective styles should support this. It works as component property. Alternatively, if anyone is aware of another way to get a theme supported color like this to work I'd be interested in that as well. What is weird is --label works in designer but not on the client :confused:


image

I'm not sure what the reason is, but named variables in perspective styles have to be wrapped inside of var(), so try var(--neutral-100) instead.

2 Likes

fwiw, I don't suggest referencing variables within component styles directly - always reference them inside of Perspective Styles and use these on components. Not a hard and fast rule, but it will make the learning curve for someone else who comes in to work on the system much easier, since PStyles are selectable in a list and CSS variables are hidden away in files

That is sound advice. The only time i've ever had cause to use style props over Pstyles is just for this reason... When I couldn't get the expected behavior from Pstyles. But, the post above solves that :pray:

Just to be clear though, I definitely support and encourage creating your own CSS theme(s) and CSS variables and using these in PStyles

I need to catch up on the latest CSS updates in perspective. I know they've added some new features... Was always looking for better support for keyframes... I know it was possible before but not straightforward and the CSS files overrode on service startup.. Its been awhile since I've played with it. I am glad I made this post as this has been a pita for me lol

Hence needing to create your own theme. The standard IA theme files are overwritten

1 Like