csslint icon indicating copy to clipboard operation
csslint copied to clipboard

error while specifying variables in CSS3 ; Expected RBRACE. This rule looks for recoverable syntax error

Open avreddy1996 opened this issue 6 years ago • 43 comments

:root{ --nvctheme-color: #3f1a67; --nvcthemelight-color: #5f259e; } this is the code I am using to define website theme color as a variable but in CSSlint it is showing error ERROR: Expected RBRACE at line 17, col 3. This rule looks for recoverable syntax errors. (errors) Browsers: All

avreddy1996 avatar Nov 07 '17 04:11 avreddy1996

Experiencing this as well.

aliceinpalth avatar Nov 23 '17 08:11 aliceinpalth

Yup, same here

adityarao310 avatar Dec 02 '17 16:12 adityarao310

The parser doesn't know how to handle CSS Variables as far as I know.

frvge avatar Dec 29 '17 14:12 frvge

Happens with me too.

varunyellina avatar Jan 08 '18 22:01 varunyellina

Support for css variables has landed in all major browsers except ie11. csslint should support it!

Redmega avatar Feb 19 '18 14:02 Redmega

Same issue here. Don't know why, but when trying to use /* csslint ignore:start / and / csslint ignore:end */ I can't get rid of errors inin CodeMirror (uses CSSLint 1.0.4). Has anyone managed to use the ignore to get rid of the css variables errors?

vrosu avatar Mar 27 '18 15:03 vrosu

@vrosu Nope, same issue as described above, really annoying. Ignoring doesn't seem to help.

JoniVR avatar Mar 31 '18 19:03 JoniVR

Ran into this issue this morning, Visual Studio won't publish css with this error, even though the pages run just fine locally.

This is a 6 month old bug, and it hasn't been addressed. If it is too hard to properly write rules to properly identify this use case, then turn off validation checking for empty rules so you don't break things while you get your logic sorted out.

Kinda irritated that I have to fight with csslint to get work done, it is costing more time than it is saving...

hroger1030 avatar Apr 20 '18 17:04 hroger1030

landed here from a search. Have a WordPress site going and the editor didn't like my variable (expected RBRACE).

LinearDynamics avatar Sep 05 '18 14:09 LinearDynamics

Is this still an issue?

BrandonDyer64 avatar Nov 17 '18 06:11 BrandonDyer64

yep. Here is lines 1-8 of a css sheet:

:root { --accent1: #777777; --accent2: #cccccc; --Background1: #000000; --Background2: #000044; --Background3: #000055; }

gives the following errors:

Severity Code Description Project File Line Suppression State Error empty-rules (CssLint) Rule is empty. Website D:\SourceCode\test\C# - gc\Website\App_Themes\PageStyle.css 1 Error errors (CssLint) Expected RBRACE at line 3, col 5. Website D:\SourceCode\test\C# - gc\Website\App_Themes\PageStyle.css 3 Error errors (CssLint) Expected RBRACE at line 4, col 5. Website D:\SourceCode\test\C# - gc\Website\App_Themes\PageStyle.css 4 Error errors (CssLint) Expected RBRACE at line 5, col 5. Website D:\SourceCode\test\C# - gc\Website\App_Themes\PageStyle.css 5 Error errors (CssLint) Expected RBRACE at line 6, col 5. Website D:\SourceCode\test\C# - gc\Website\App_Themes\PageStyle.css 6 Error errors (CssLint) Expected RBRACE at line 7, col 5. Website D:\SourceCode\test\C# - gc\Website\App_Themes\PageStyle.css 7

hroger1030 avatar Nov 20 '18 06:11 hroger1030

I have the same problem, it gives no error in appveyor client test but in visual studio where my backend included I see errors like above for my variables.css :root{ --accent-color: #5491db; --nav-back-color:#353b44; ... } Anyone can help please?

parak80 avatar Nov 27 '18 08:11 parak80

@parak80 There's not really anything you can do. It's an issue with CSSLint. This issue has been open for over a year.

Speaking of which, are there any Pull Requests addressing this issue?

BrandonDyer64 avatar Nov 28 '18 07:11 BrandonDyer64

https://github.com/CSSLint/parser-lib/pull/248 got opened a few days ago.

frvge avatar Dec 09 '18 21:12 frvge

Looks like the parser-lib PR is in limbo as the contributor is not working on it anymore. :(

shaunrashid avatar Mar 18 '19 16:03 shaunrashid

Anything new on this ?

EliasTouil avatar Jul 04 '19 01:07 EliasTouil

I've opened a pull request to fix this, in case we want to avoid #754.

mattiacci avatar Jul 17 '19 04:07 mattiacci

I'm happy to merge it, but I don't have the power to make an official release for neither parser-lib nor csslint itself.

frvge avatar Jul 18 '19 17:07 frvge

For what it's worth- If my .css files is closed then the .net solution is buildable without the errors

4ist avatar Aug 19 '19 13:08 4ist

WTF!!! We are living in 2019 and still struggling with this? I hate visual studio.

tahaygun avatar Aug 26 '19 12:08 tahaygun

@tahaygun I am equally frustrated, but I don't think this has anything to do with Visual Studio.

BrandonDyer64 avatar Aug 28 '19 18:08 BrandonDyer64

@BrandonDyer64 probably you are right. I jumped from vscode to visual studio and really hated it.. So I can't afford anything about it. I go crazy every time when I face with a problem.

tahaygun avatar Aug 28 '19 19:08 tahaygun

Also got this error with a WordPress site.

BrandonWingerAir avatar Aug 30 '19 00:08 BrandonWingerAir

@BrandonWingerAir Could you get rid of this error? I also got this error is my CSS files within WordPress...

babakmomeni avatar Sep 23 '19 10:09 babakmomeni

I'm happy to merge it, but I don't have the power to make an official release for neither parser-lib nor csslint itself.

@nschonni Can you make a release?

codler avatar Oct 15 '19 07:10 codler

I'm still confused and in need of help for this

Ademord avatar Mar 04 '20 14:03 Ademord

@Ademord I have no hope of solving this problem. The last significant commit was made in 2017. Everything looks like the project is abandoned and dead.

cawa-93 avatar Mar 04 '20 14:03 cawa-93

Codacy, which I think uses CSSLint, has this issue too.

sidvenu avatar Apr 10 '20 15:04 sidvenu

I am facing this as well. Probably, I will turn off the CSS Lint. I am tired.

oluwafemi-love avatar May 28 '20 23:05 oluwafemi-love

@nschonni Pinging you, as you're listed in the @CSSLint organization and actively contributing to other linters. Do you know CSSLint's current maintenance status?

bb010g avatar Jun 26 '20 02:06 bb010g