Is it possible de watch updates on a CSS Variable ? #3570
-
I'm quite new to Lit and love it ! For one component that I'm creating it needs to be CSS driven via CSS variables. I'm not sure if there is a way in Lit to listen/watch some changes on CSS variables like we can with HTML properties ? Thanks ! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Lit does not do anything special with CSS variables & custom properties, and unfortunately the web platform does not have the feature to watch CSS custom properties changing. I'll mark this question as answered since this answers the question directly, but please leave a comment on my response with what you're trying to achieve, because there may be a better way to do what you're trying to do that does not involve listening for custom prop changes. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply. I ended up creating a hidden |
Beta Was this translation helpful? Give feedback.
-
The CSS container query spec intends to add a |
Beta Was this translation helpful? Give feedback.
Lit does not do anything special with CSS variables & custom properties, and unfortunately the web platform does not have the feature to watch CSS custom properties changing.
I'll mark this question as answered since this answers the question directly, but please leave a comment on my response with what you're trying to achieve, because there may be a better way to do what you're trying to do that does not involve listening for custom prop changes.