Live data from Hacker News

CSS 'frameworks' are missing the point (2008)

stackoverflow.com

21–30 of 44 posts

Re: CSS 'frameworks' are missing the point (2008)

#21
post #11
post #4

Completely invalid advice in 2014. LESS and SASS now provide everything that CSS "can't do" in this answer.

The answer is still valid. LESS and SASS are CSS preprocessors, not frameworks. Sending spaghetti code to the user's browser can be limited but LESS and SASS do not address the flaw of CSS frameworks.

I think the point is that frameworks can be more effective now thanks to tools like LESS and SASS (it's certainly possible to use Bootstrap this way, at least with the sass translation). Compass is another example of a framework that SASS enables.

Bloat of a hundred framework rules? - None of these will be included if you use mixins and selectively mixin the stuff you need.

Unsemantic grid sizes - Personally, I think this is something where utility trumps perceived "cleanness" of semantic HTML, but if you want to you can use mixins for this as well to hide the grid stuff in your CSS.

Not responsive - SASS and LESS don't do anything specific here, but this is definitely an outdated comment - Bootstrap's responsive grid is probably better than anything you could code yourself without devoting a lot of effort to it.

Re: CSS 'frameworks' are missing the point (2008)

#22

I totally agree and have been saying this for years. CSS frameworks run a high risk of overkill for 99% of apps. They also offer no potential for learning and it's more difficult to strip back a framework than it is to build your own. It's also super boring. No idea why anyone uses them for any creative work. Also what is the deal with grid systems!?

They're really useful, and been around forever. http://en.wikipedia.org/wiki/Grid_(graphic_design)

Re: CSS 'frameworks' are missing the point (2008)

#23
Pause the baby-photo gawking for a moment and consider the argument that's still valid. There's an interesting reason why it is not entirely possible to separate content from presentation: one cannot be abstracted from the other. And this is interesting rather than a commonplace because -- mark this closely -- we're still doing something, some useful work, when the HTML and CSS are put in separate files, even when the classes are things like 'span-27'.

So what are we doing?

Re: CSS 'frameworks' are missing the point (2008)

#24

I don't know about you "leet hacker pros" but I do know that using bootstrap 3 helped me make my site[1] completely responsive - with ease the like of which the world has never seen the like of which[2]. If you are using bootstrap for it's color choices you're doing it wrong. What I do is have bootstrap.css vanilla loaded, then I load a bootstrap_overrides.css.scss where I override styles/colors/looknfeel. Make boots…

You can download bootstrap, modify their variables and compile it yourself. That way you don't have load more than one files and have rules that will never get used.

Re: CSS 'frameworks' are missing the point (2008)

#25
Useless, not so much. The best solution all the time? Also not so much.

I agree with the points about it being just a large set of declarations, there aren't a lot of good ways to lazy load CSS (that I know of) so in some cases you're pushing a lot of bytes that you don't need to and creating dead weight.

Also the presentation in markup point is one I have been saying for years. We hear about the death of tables and why it needed to happen and go back and do similar stuff. But without extensive use of something like jQuery you have to do it.

I think these frameworks are awesome for people like me. I'm a backend coder, and I am not that good at CSS. I love being able to whip out a layout and interfaces in a fraction of the time, so I can focus on what I do best. It's not that I'm afraid of CSS (I can write it) it's just that I'm afraid of wasting time.

This is the primary reason these frameworks have flourished IMO. Useless? Not even close.

Re: CSS 'frameworks' are missing the point (2008)

#26

Even with less or sass, a basic, modern grid will have at least three levels of DOM-level logic that determines presentation, so you have things like this: that you could perhaps use mixins to replace some of the elements with (you could mix-in "row" to "nav-header", and "col-sm-2" to "my-logo"), but regardless, you still need three DOM nodes, and trying to fit those into a purely semantic separate-structure-from-pre…

I have the same conflicting feelings about it. One the one hand, yes the HTML should be semantic and not have things in it like "col-2". My thinking is that it's not so terrible as long as it's classnames. The tags and IDs can be more semantic and the classnames I kinda allow the cheating in my mind, considering it to be meta-data.

At a certain point we do actually have to produce a site or an app. If I mange to get the product released while keeping the code clean, organized and consistent then I feel like I'm doing OK.

Re: CSS 'frameworks' are missing the point (2008)

#27

I don't know about you "leet hacker pros" but I do know that using bootstrap 3 helped me make my site[1] completely responsive - with ease the like of which the world has never seen the like of which[2]. If you are using bootstrap for it's color choices you're doing it wrong. What I do is have bootstrap.css vanilla loaded, then I load a bootstrap_overrides.css.scss where I override styles/colors/looknfeel. Make boots…

You can compile Bootstrap yourself from LESS or SASS, pushing your own values into the Bootstrap variables (and ideally sharing this configuration with your custom styles). In the process you can choose not to include some Bootstrap components, reducing it's weight significantly. It's NOT a lightweight framework.

Re: CSS 'frameworks' are missing the point (2008)

#28

Even with less or sass, a basic, modern grid will have at least three levels of DOM-level logic that determines presentation, so you have things like this: that you could perhaps use mixins to replace some of the elements with (you could mix-in "row" to "nav-header", and "col-sm-2" to "my-logo"), but regardless, you still need three DOM nodes, and trying to fit those into a purely semantic separate-structure-from-pre…

You should check out Bourbon Neat: http://neat.bourbon.io/, or leverage Sass' @extend directive.

Your CSS could easily be shortened to:

  .body {
    @extend .container;
  }

  .nav-header {
    @extend .row;
  }

  .my-logo {
    @extend .col-sm-2;
  }
And your markup could be much cleaner:

  
    
      
        
      
    
  

Re: CSS 'frameworks' are missing the point (2008)

#29
post #27

I don't know about you "leet hacker pros" but I do know that using bootstrap 3 helped me make my site[1] completely responsive - with ease the like of which the world has never seen the like of which[2]. If you are using bootstrap for it's color choices you're doing it wrong. What I do is have bootstrap.css vanilla loaded, then I load a bootstrap_overrides.css.scss where I override styles/colors/looknfeel. Make boots…

You can compile Bootstrap yourself from LESS or SASS, pushing your own values into the Bootstrap variables (and ideally sharing this configuration with your custom styles). In the process you can choose not to include some Bootstrap components, reducing it's weight significantly. It's NOT a lightweight framework.

I know I can do this, but I don't because I prefer to just download the boostrap latest vanilla, and override as needed. That way every time there is a new version I don't have to do mental gymnastics on what variables are new or renamed.

Re: CSS 'frameworks' are missing the point (2008)

#30

Useless, not so much. The best solution all the time? Also not so much. I agree with the points about it being just a large set of declarations, there aren't a lot of good ways to lazy load CSS (that I know of) so in some cases you're pushing a lot of bytes that you don't need to and creating dead weight. Also the presentation in markup point is one I have been saying for years. We hear about the death of tables and…

Exactly. For someone like me who likes building websites for fun (and by myself), but sucks at design and CSS, Bootstrap is a godsend. Because of it, I can concentrate on the stuff that's fun for me while having a pretty reasonable-looking website.
Post reply on HN