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 · 43 comments

Comments

@avreddy1996
Copy link

avreddy1996 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
Copy link

Experiencing this as well.

@adityarao310
Copy link

Yup, same here

@frvge
Copy link
Contributor

frvge commented Dec 29, 2017

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

@varunyellina
Copy link

Happens with me too.

@Redmega
Copy link

Redmega commented Feb 19, 2018

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

@vrosu
Copy link

vrosu 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
Copy link

JoniVR commented Mar 31, 2018

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

@hroger1030
Copy link

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
Because of CSSLint/csslint#720, we need to disable csslint.

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

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

@BrandonDyer64
Copy link

Is this still an issue?

@hroger1030
Copy link

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
Copy link

parak80 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
Copy link

@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
Copy link
Contributor

frvge commented Dec 9, 2018

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

@shaunrashid
Copy link

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

@EliasTouil
Copy link

Anything new on this ?

@mattiacci
Copy link
Contributor

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

@frvge
Copy link
Contributor

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

@4ist
Copy link

4ist commented Aug 19, 2019

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

@tahaygun
Copy link

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

@BrandonDyer64
Copy link

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

@tahaygun
Copy link

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

@BrandonWingerAir
Copy link

Also got this error with a WordPress site.

@babakmomeni
Copy link

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

@codler
Copy link

codler commented Oct 15, 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.

@nschonni Can you make a release?

@Ademord
Copy link

Ademord commented Mar 4, 2020

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

@cawa-93
Copy link

cawa-93 commented Mar 4, 2020

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

@sidvenu
Copy link

sidvenu commented Apr 10, 2020

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

@oluwafemi-love
Copy link

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

@bb010g
Copy link

bb010g commented Jun 26, 2020

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

@Xmetalfanx
Copy link

yeah, using Codacy here for a few projects and one of the few reasons it gets rated lower is due to this issue ... I REALLY didn't expect the issue to be this old and still going

jdsutherland added a commit to jdsutherland/bracey.vim that referenced this issue Sep 6, 2020
csslint is dead and doesn't support newer CSS features
See CSSLint/csslint#720
This causes false positives that blow up Bracey
Could probably be replaced with stylelint
jdsutherland added a commit to jdsutherland/bracey.vim that referenced this issue Sep 6, 2020
csslint is dead and doesn't support newer CSS features
See CSSLint/csslint#720
This causes false positives that blow up Bracey
Could probably be replaced with stylelint
Kristinita added a commit to Kristinita/KristinitaPelican that referenced this issue Nov 16, 2020
perf(jquery) remove JQuery, replace all JQuery dependencies

perf(deferjs): migrate to Defer.js — https://appseeds.net/defer.js/demo.html

refactor(pelican): single template for articles and pages with includes — https://bernhard.scheirle.de/posts/2016/March/07/seo-how-to-exclude-pages-and-articles-with-pelican/#how-to-use-the-noindex-html-meta-tag-with-pelican

perf(fonts): increase fonts downloading speed — https://csswizardry.com/2020/05/the-fastest-google-fonts/

refactor(peru): remove all Python third-party packages from repository — buildinspace/peru#205 (comment)

upd(python): Python and Pipenv to latest versions

fix(just_table): apply just_table for all types of articles and pages — burakkose/just_table#9

upd(css): migrate from PurifyCSS to PurgeCSS

lint(links): checkPages for checking internal links — https://www.npmjs.com/package/check-pages

fix(accessibility): some improvements for the own code and Gemini scrollbar — noeldelgado/gemini-scrollbar#67

fix(favicons): apply RealFavicon for all HTML

lint(csslint): drop CSSLint support, I can’t ignore CSS4 parts of a code — CSSLint/csslint#720 (comment)
@circuitsacul
Copy link

2021 and this issue is still an issue?

@thenexus00
Copy link

2021 and this issue is still an issue?

Yes, Crazy hey.

@GeneralMine
Copy link

Can confirm that's still an issue...

@DevWeb13
Copy link

26/10/2021 Always the issue in codacy...

@tomivm
Copy link

tomivm commented Dec 15, 2021

15/12/2021 the issue persists in codacy

@S0AndS0
Copy link

S0AndS0 commented Jan 15, 2022

For those that land here after a web-search, the following Awk/Bash wrapper script is what I currently use to ignore RBRACE errors related to CSS custom properties;

#!/usr/bin/env bash

_args=( "${@?No arguments provided}" );

awk 'BEGIN {
  delete buffer;
  after_match = 1;
  header_amount = 5;

  pattern_one = "RBRACE";
  pattern_two = ".*--\\w(-|\\w)+:";

  matched_one = 0;
  counter = 0;
}
{
  ## Print header
  if (NR < header_amount) {
    print $0;
    next;
  }

  if (!matched_one) {
    if ($0 ~ pattern_one) {
      # print "## MATCHED PATTERN ONE";
      delete buffer;
      matched_one = 1;
    } else {
      buffer[length(buffer)] = $0;
      if (!length($0)) {
        for (i in buffer) {
          print buffer[i];
        }
        delete buffer;
      }
    }
  } else {
    if ($0 ~ pattern_two) {
      counter++;
    } else if (counter > after_match) {
      counter = 0;
      matched_one = 0;
    }
  }
}' < <(csslint "${_args[@]}");

@chris-oliver-getvisibility

It's clear that this repository has been abandoned.

Does anybody know if there is a spiritual successor?

@S0AndS0
Copy link

S0AndS0 commented Mar 26, 2023

@chris-oliver-getvisibility recently I went on the hunt for alternatives, and it seems stylelint may be able to satisfy the want of CSS (and SCSS) linting... though I've yet to make the time to test it 🤷

@chris-oliver-getvisibility

Thanks @S0AndS0 !

@linusjf
Copy link

linusjf commented Feb 9, 2024

Any updates on this? CSS variables are breaking csslint.

@linusjf
Copy link

linusjf commented Feb 10, 2024

Dropped the use of csslint from my project. stylelint seems to be the way forward.

@Xmetalfanx
Copy link

Dropped the use of csslint from my project. stylelint seems to be the way forward.

i am not even sure (it was at LEAST MONTHS ago or longer) but i think that is what i did here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests