3

I am trying to use variables in my CSS3 file, I have used following code

:root{
--nvc-theme: green;
--nvc-themelite: grey;
}

this is the css I am using to declare two variables in my project but when I compile CSS with csslint it is showing error

ERROR: Expected RBRACE at line 17, col 3. This rule looks for recoverable syntax 
errors. (errors) Browsers: All

and it is also showing

WARNING: Rule is empty. Rules without any properties specified should be removed.
 (empty-rules) Browsers: All

I know this warning because in the root element I have used only variables I didn't declare any css properties just variables so it is showing a warning, but how can I overcome this situation. Any solution helps a lot. Thank you

Aravind Reddy
  • 747
  • 6
  • 20
  • Acording to this lib (https://www.npmjs.com/package/csslint-next), CSS variables seems to be not supported by csslint. Maybe give a try to this one or another one? – sjahan Nov 07 '17 at 10:18
  • thanks. but i have already read that some thing issue with csslint only but i have a limitation to use csslint only – Aravind Reddy Nov 07 '17 at 10:21
  • I don't know it very much, maybe you can set some exception or disable some rules to prevent these errors? Since it's a parsing problem, it feels like you won't be able to fix it easily though... it seems rather low level. – sjahan Nov 07 '17 at 10:23
  • How to set an exception or disable rules – Aravind Reddy Nov 07 '17 at 10:26
  • I don't know if it's possible, you should check the docs, but using eslint, that's how it works! – sjahan Nov 07 '17 at 10:31

1 Answers1

0

Given an outstanding issue on github for this problem, and another issue asking "Is anyone here?" with no response from the devs and no real way to merge fix in, it doesn't seem this will be fixed any time soon.

So your only real option is to migrate to a different lint such as stylelint

gbjbaanb
  • 51,617
  • 12
  • 104
  • 148
  • for one single issue changing the whole project lint? is that a good idea? and i have posted issue in github also before posting this question – Aravind Reddy Dec 11 '17 at 07:08
  • @AravindReddy its not the issue, its whether the project is no longer maintained - as it is beginning to appear to be. Anyway, the answer (today at least) is that there is no way to fix it, and one solution is to change linter to one that does. – gbjbaanb Dec 11 '17 at 13:10