News for hackers. Stuff that matters.
Re:CSS Lint is harmful by damncabbage on Monday July 11, 2011 @08:00AM (#2750301)
There's opinionated, and there's badly-thought-out. From the article:

  = Don’t use too many floats =
  Arbitrary, and impossible to test for. All Lint is
  doing is counting how many times you declare "float"
  in a stylesheet. It doesn’t matter that you may only
  ever use one float on a given page.

I agree with Wilcox on this; between that, "Don't qualify headings" and "Don’t use IDs in selectors", I'm not crash-hot on using CSSLint for anything other than plain syntax checking.
Re:CSS Lint is harmful by telemachos on Monday July 11, 2011 @08:19AM (#2750339)
>> using CSSLint for anything other than plain syntax checking.

More straightforward to use the W3C's CSS validator for that: http://jigsaw.w3.org/css-validator/#validate_by_uri+with_opt...

Re:CSS Lint is harmful by bobfunk on Monday July 11, 2011 @08:21AM (#2750347)
I don't think the "Don't use too many floats" is meant to say anything about performance, but about maintenance.

I think the point is, that if you have to put "float" in lots of declaration, you're missing some abstractions in your css. Most likely a grid plus some classes for inline lists.

Again, CSS Lint is very opinionated, and some of it opinions are contrary to various best practices (especially the fundamentalist approach to not let any classes in the HTML have anything to do with presentation). But from the perspective of these opinions based on how to write maintainable CSS and HTML for large sites, the rules makes a lot of sense.

Re:CSS Lint is harmful by pornel on Monday July 11, 2011 @08:37AM (#2750403)
I don't think maintenance difficulties are related to number of float declarations.

I could make layout a ticking time bomb just by using one shrink-wrapped floated column without clear.

I could make mess of an entire site with just:

    .left {float:left}
(which I've seen used in practice)

And I can write perfectly maintainable code with lots of floats if I have them sized and cleared properly.

Re:CSS Lint is harmful by voidfiles on Monday July 11, 2011 @12:20PM (#2751330)
Having too many floats is the canary in the coal mine. It's there to help you have a sense of how well you are structuring your CSS.
Re:CSS Lint is harmful by pbhjpbhj on Monday July 11, 2011 @08:39AM (#2750413)
It gives a float warning. Seems reasonable to me. A warning doesn't mean you have to change anything it just means you might want to look at this. If you understand your code and know that the multiple floats are there on purpose then there's nothing more to do. Like someone else said this is a "perhaps you should be using a proper grid" warning.
Re:CSS Lint is harmful by catshirt on Monday July 11, 2011 @10:08AM (#2750712)
I'll quote something from CSS lint I've quoted here before and probably will have to quote again; "CSS Lint simply checks to see if you've used float more than 10 times, and if so, displays a warning. Using this many floats usually means you need some sort of abstraction to achieve the layout.".

Really, honestly, what does this even mean?

Re:CSS Lint is harmful by huckfinnaafb on Monday July 11, 2011 @10:23AM (#2750781)
"CSS Lint simply checks to see if you've used float more than 10 times, and if so, displays a warning. Using this many floats usually means you need some sort of abstraction to achieve the layout."

I suspect this means you should be using a grid system, either hand written or borrowed from somewhere that writes grid systems. Constantly using float everywhere is completely unnecessary for larger sites.

Re:CSS Lint is harmful by catshirt on Monday July 11, 2011 @11:31AM (#2751111)
sorry... grids float, no?
Re:CSS Lint is harmful by huckfinnaafb on Monday July 11, 2011 @11:50AM (#2751208)
...yes, but they often only declare it once.
Re:CSS Lint is harmful by voidfiles on Monday July 11, 2011 @12:23PM (#2751343)
I think the point is that if you are using floats in too many places you there are probably a whole host of other problems with your CSS. If you took the time to go over your CSS, and find where you are duplicating effort you might be able to reduce the number of CSS classes you are using by finding a common pattern. Thus abstracting your CSS.