简体   繁体   English

声明CSS3变量时浏览器错误,预期为RBRACE,此规则查找可恢复的语法错误

[英]browser error while declaring CSS3 variables, Expected RBRACE, This rule looks for recoverable syntax error

I am trying to use variables in my CSS3 file, I have used following code 我正在尝试在CSS3文件中使用变量,我使用了以下代码

: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 这是我用来在项目中声明两个变量的css,但是当我使用csslint编译CSS时显示错误

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. 我知道此警告,因为在根元素中我仅使用了变量,而没有声明任何CSS属性,而只是声明了变量,因此它显示了警告,但是我该如何克服这种情况。 Any solution helps a lot. 任何解决方案都有很大帮助。 Thank you 谢谢

Given an outstanding issue on github for this problem, and another issue asking "Is anyone here?" 鉴于github上有一个未解决的问题,另一个问题是“有人在吗?” 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 因此,您唯一的实际选择是迁移到其他样式lintlint的棉绒

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM