stubbornella/csslint — Issue #245: Leading semicolon (un)forgivable?
Author: iDGS
Created: 2012-02-21 22:28:40+00:00
State: open

Silly, I know, but when composing, I like to align all the "fly specks" of CSS where I can easily see them, E.g.,

nav ul
, nav ol
{
;	list-style	:	none
;	list-style-image	:	none
}

(Hope you didn't hurt yourself when you fainted ;-) I'd argue (briefly, and none too stridently) that it's in the OOCSS tradition to separate container from content, which is what I'm doing visually by getting those braces onto lines of their own, and by pulling the commas, colons and semicolons into columns where it takes but a glance to verify that my fat fingers haven't done other than what was intended. (Most of my typos involve those 3 characters--you?) As a fringe benefit, that {;;} column makes a nice visual "wrapper" IMHO, and--best of all--I can copy/paste lines in any order with impunity, never having to worry about those braces. Mash it all into unreadability later, if you must. No big deal. However,...

You guessed it--CSS Lint is a little, um, "unfriendly" to that first semicolon, saying :

4	5	Parsing Errors	Expected RBRACE at line 4, col 5.
;	list-style	:	none

Yet, I've previously searched the W3C CSS spec, and couldn't find a prohibition against the above style of CSS coding. Indeed, the W3C validator does not complain, nor do any of the browsers I've tested it on. So...

Is it really, REALLY a parsing error?

Or, if it's actually forgivable, may I humble ask that you would? :-)