Creating variables in CSS
Permalink
I would like to create several variables in CSS to hold custom color definitions. WIth Clonamental, in the "Custom CSS" section of the design panel I tried adding this example (picked up from the W3 tutorial site--I'm a novice in these matters)
But the editor for the Custom CSS section flags that up as having errors (related to braces, but probably not the real problem). Is this the wrong place for that sort of code, or something else? Thanks.
:root { --blue: #1e90ff; --white: #ffffff; }
But the editor for the Custom CSS section flags that up as having errors (related to braces, but probably not the real problem). Is this the wrong place for that sort of code, or something else? Thanks.
Your variables will still be there despite the perceived "error" I think that CSS editor pre-dates CSS variables, so simply doesn't recognise them, you can check they have been added to your site, by looking at the page source right click on your page, then click "View page source" then hit "Ctrl + F" to search the page and do a search for ":root" it should show you that your CSS has been added in some style tags on the page.