Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSSLint: Ignore single line in CSS file?

Tags:

css

csslint

I'm working with a CSS file that uses Mozilla's -moz-element(#element) directive for a background-image. The code looks like:

#foo {background-image: -moz-element(#element);}

When I run this through CSSLint, it tells me that the "Rule is empty", despite the fact that it's obviously not. I could attempt to run CSSLint via command line and use --ignore, but what I'm really looking for is a way to ignore just that single line from within my CSS file. Is there a way to do that?

And just for clarity, what I'm looking for is the analogue to how JSHint does things, which looks like this:

var notChecked = 'This line won't get checked'; // jshint ignore:line

like image 431
Funktr0n Avatar asked Mar 25 '15 06:03

Funktr0n


2 Answers

Using an embedded ruleset:

/*csslint important: false*/

.example {
  display: none ! important 
}

/*csslint important: true*/
like image 162
peterorum Avatar answered Sep 28 '22 10:09

peterorum


CSSLint does not currently support a single-line ignore function from within a CSS file. Hopefully (would be awesome!) this changes in the future.

like image 44
Funktr0n Avatar answered Sep 28 '22 10:09

Funktr0n