stubbornella / oocss

Object Oriented CSS Framework

Home Page:http://stubbornella.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

False positives in the "Unique headings" rule

MikeHopley opened this issue · comments

I'm seeing two cases of this warning that I think are false positives:

  1. When using a reset stylesheet, you always get this warning, because a heading must be defined in at least two locations (one+ for the reset, one for your own styles).

In the case of a website using the OOCSS reset and all six levels of heading, you would get at least 12 misleading warnings from CSS Lint (OOCSS resets headings in two places).

  1. When several levels of heading share code, it's shorter and more DRY to have multiple declarations. For example, this code would incur three warnings from CSS Lint.:

h1, h2, h3 {
font-family: "Trebuchet MS", sans-serif;
font-size-adjust: 0.523;
letter-spacing: -1px;
color: #265aa7;
font-size: 200%; /* Sets size for h1 */
}
h2 {
font-size: 150%;
}
h3 {
font-size: 120%;
}

In both situations, styles are being applied to the base selector (i.e. "h2" and not "#sidebar h2").

Would it not be better to remove the "unique headings" rule, while keeping the "don't qualify headings" rule? The latter seems to cover everything you want without any false positives.

This should be filed for CSS Lint, rather than OOCSS. Thanks!