Questions tagged [csslint]

csslint is a program used to parse CSS and flag syntax errors, anti-patterns, and redundant declarations.

csslint is open-source and has command-line, browser, and IDE interfaces.

79 questions
28
votes
6 answers

Why selecting by ID is not recommended in CSS?

In CSS Lint, they don't recommend using an id for selecting elements. I trust CSS Lint because it written by smart people who know CSS very good and in depth. But I want to know what are reasons of this? Why is selecting with an id not a good thing?
Mohsen
  • 64,437
  • 34
  • 159
  • 186
13
votes
2 answers

Making sense of CSS Lint warnings

I am writing the CSS for our website and I just ran it through CSS Lint. I'm struggling making sense of quite a few of the warnings so would greatly the community's assistance. Don't use IDs in selectors. Isn't that the point of the IDs? To be used…
Kayote
  • 14,579
  • 25
  • 85
  • 144
10
votes
3 answers

"Don't use IDs in selectors (CSS)" then, what to use instead of IDs?

One of CSS lint rules is: "It's better to not use IDs in selectors". So, what should we use instead of IDs to point to a unique element? For example, say I have dozens of elements that have a class named my-class, and I want only one of them to have…
Arad Alvand
  • 8,607
  • 10
  • 51
  • 71
8
votes
3 answers

csslint - broken box model

I've used CSSLint for my stylesheets and I get one warning that I don't understand. Consider this CSS Code: div { width: 50px; height: 50px; border: 1px solid; } CSSLint says the following: "Broken box model: using height with…
js-coder
  • 8,134
  • 9
  • 42
  • 59
8
votes
1 answer

CSSLint : How to config tasks just print error not warning

I'm new with Grunt - csslint plugin, after I run and cssLint task complete, there are many and many errors and warnings that I can't follow. So how to config task just print out the errors, not warning??
kate
  • 179
  • 2
  • 16
8
votes
1 answer

displaying jsHint and cssLint results in sonar

jsHint and cssLint can output their results in to standard xml (sjlint.xml and csslint.xml format) file. Is there a way to display those results with sonar? What I'm trying to do is to run a jenkins job that will run validations on java script and…
Vitali Bichov
  • 988
  • 2
  • 12
  • 26
7
votes
2 answers

Simple css :before:hover not working? CSSlint no errors?

http://jsfiddle.net/nicktheandroid/k93ZK/2/ This should be really simple, I just don't understand why it's not working. When hovering over the :before it should change it's opacity to 1, but it doesn't. Why? p { padding-top:15px; …
android.nick
  • 11,069
  • 23
  • 77
  • 112
7
votes
1 answer

CSS Lint ignore all IE6 and IE7 based errors

I'm using Sublime Text 3, and CSS Linter. In my settings I've put the ignore rule, and currently there is only the "outline-none" rule, I'd like to include all the rules which refer to IE6 and IE7 based errors. Is there a list what are the IE6 and…
dingo_d
  • 11,160
  • 11
  • 73
  • 132
7
votes
4 answers

How to ignore specific warnings outputted by the CSSLint extension for Brackets

I'm using the CSSLint extension for Brackets. Is there a way to disable specific warnings for things like box-model and @bulletproof-font-face? The best match I've found for a discussion is here. At the moment I'm hoping to use a preamble in my CSS…
Joel DeWitt
  • 1,226
  • 2
  • 13
  • 26
7
votes
1 answer

How do you use csslint from the command line?

I'm new to Ubuntu, I'll be the first to admit that, but I need to integrate csslint into a CI build script and I found the about page on the csslint site unhelpful. It gave me two options for installing csslint but they require either node or…
Nickel
  • 533
  • 1
  • 7
  • 20
6
votes
4 answers

CSSLint: Ignore single line in CSS file?

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",…
Funktr0n
  • 1,711
  • 2
  • 16
  • 23
5
votes
3 answers

finding vim efm for csslint messages

With the newly released csslint I wanted to try to hook it into vim as my makefile for .css files. I'm having a hard time getting the multi-line error format working for the output. My best result so far is: au BufRead *.css set makeprg=csslint\…
Rick
  • 15,484
  • 5
  • 25
  • 29
5
votes
1 answer

CssLint : Unknown property "fill"

I'm changing an SVG path color via css : .compute .svg path { fill: #fff; } It works just fine, but when running cssLint over it, I had this warning: Unknown property: "fill" Is it a cssLint error? Or is it a bad thing to use this property in…
Romain Braun
  • 3,624
  • 4
  • 23
  • 46
5
votes
2 answers

csslint Warning - The box-sizing property isn't supported in IE6 and IE7

I am using CSSLint for the first time and trying it now. When I write following CSS .div { box-sizing: border-box; border: 1px solid red; padding: 5px; width: 100px; } Then when I run Warning - The box-sizing property isn't…
Om3ga
  • 30,465
  • 43
  • 141
  • 221
5
votes
1 answer

Headings should only be defined once

Just ran a decent amount of css through csslint, mainly to check for errors. 80% of the warnings I get are from defining the same header element more than once. So I was wondering what the best way to clean up these kind of styles would be... h4 { …
1
2 3 4 5 6