Join the Webstudio community

Updated 6 months ago

Strange thing with Variables

At a glance

A community member is testing out CSS variables and encountered an issue where the text color is not changing as expected. The CSS Preview shows the variable is applied correctly, but the text remains black. The community members discuss that the issue may be caused by having a space in the variable name, and suggest that the application should prevent users from using spaces in variable names and show a validation error instead. The issue is then created on a GitHub repository to address this problem.

Useful resources
hey there, i am testing out the new css variables. I got a strange thing accuring.

I've set the --text primary: rgba(206, 207, 210, 1) on the body. Should be a light gray.
The CSS Preview is showing that the variable is applied for that text element in the screenshot. But the text color is black. What am i missing?

thanks ❀️
Attachments
Bildschirmfoto_2024-10-15_um_19.38.56.png
Bildschirmfoto_2024-10-15_um_19.39.05.png
Bildschirmfoto_2024-10-15_um_19.39.43.png
O
p
5 comments
variable name can't have space
@TrySound we need to prevent user from using space in there, show validation error
thanks, that was it πŸ™‚
yeah would be super to prevent that.
Add a reply
Sign up and join the conversation on Discord