CSSLint: Ignore single line in CSS file?

Funktr0n picture Funktr0n · Mar 25, 2015 · Viewed 7.1k times · Source

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

Answer

peterorum picture peterorum · Feb 8, 2016

Using an embedded ruleset:

/*csslint important: false*/

.example {
  display: none ! important 
}

/*csslint important: true*/