Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
avreddy1996 opened this issue Nov 7, 2017 · 18 comments

Comments

@avreddy1996
Copy link

commented Nov 7, 2017

: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

@aliceinpalth

This comment has been minimized.

Copy link

commented Nov 23, 2017

Experiencing this as well.

@adityarao310

This comment has been minimized.

Copy link

commented Dec 2, 2017

Yup, same here

@frvge

This comment has been minimized.

Copy link
Contributor

commented Dec 29, 2017

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

@varunyellina

This comment has been minimized.

Copy link

commented Jan 8, 2018

Happens with me too.

@Redmega

This comment has been minimized.

Copy link

commented Feb 19, 2018

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

@vrosu

This comment has been minimized.

Copy link

commented Mar 27, 2018

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?

@JoniVR

This comment has been minimized.

Copy link

commented Mar 31, 2018

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

@hroger1030

This comment has been minimized.

Copy link

commented Apr 20, 2018

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...

ErikHellman added a commit to webrtc/samples that referenced this issue Aug 8, 2018

Removed csslint from test job
Because of CSSLint/csslint#720, we need to disable csslint.

TL;DR: csslint doesn't support custom vars in CSS.
@LinearDynamics

This comment has been minimized.

Copy link

commented Sep 5, 2018

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

@BrandonDyer64

This comment has been minimized.

Copy link

commented Nov 17, 2018

Is this still an issue?

@hroger1030

This comment has been minimized.

Copy link

commented Nov 20, 2018

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

:root
{
--accent1: #777777;
--accent2: #cccccc;
--Background1: #000000;
--Background2: #44;
--Background3: #55;
}

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

@parak80

This comment has been minimized.

Copy link

commented Nov 27, 2018

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?

@BrandonDyer64

This comment has been minimized.

Copy link

commented Nov 28, 2018

@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?

@frvge

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2018

CSSLint/parser-lib#248 got opened a few days ago.

@shaunrashid

This comment has been minimized.

Copy link

commented Mar 18, 2019

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

@EliasTouil

This comment has been minimized.

Copy link

commented Jul 4, 2019

Anything new on this ?

@mattiacci

This comment has been minimized.

Copy link
Contributor

commented Jul 17, 2019

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

@frvge

This comment has been minimized.

Copy link
Contributor

commented Jul 18, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.