The following is valid CSS in my opinion as per W3 schools and other websites:
:root {
--primary-bg-color: green; /* global scope */
}
However most linters like https://prettier.io/ gives a error when parsing my example:
SyntaxError: Unexpected token (1:1)
> 1 | :root {
| ^
2 | --primary-bg-color: green; /* global scope */
3 | }
I'm not really experienced with CSS so the linter behavior raises questions for me:
- Am I mistaken for thinking that this is valid CSS?
- Why is the linters complaining?
- How do I format it so that a linter would be happy with my syntax.
--parsermust be set tocss... I assume it was trying to parse the content as something else.babel