Ask HN: To Bootstrap or Not to Bootstrap?
I have been using bootstrap for years and generally prefer it as the starting point on all of my front end designs. But I'm working on a project right now with another developer who doesn't want to use it because he says it's heavy and doesn't follow best design practices.
I have never had a problem before. What do you think? Why not use bootstrap?
20 comments
[ 4.7 ms ] story [ 62.1 ms ] threadIf nobody else is going to be editing the project then it's really just a tradeoff between your own time vs download size, if you can afford to shave a few hundred kilobytes off your first page load that can be a big improvement for many audiences.
I've been favoring Skeleton as a significantly lighter alternative, although it is very small in comparison to bootstrap - http://getskeleton.com.
As far as being heavy, just go through and throw out the stuff you don't need. It's reasonably modular.
It seems as if the other developer doesn't like how default bootstrap looks (or is bored by the overuse of default bootstrap), and he's justifying his preference.
Otherwise, ask him what "best practices" are missed.
I'm interested in learning more about how to take advantage of the good parts of bootstrap without having a site that looks too much like vanilla bootstrap.
We get a design proof, in PSD format. I mentally translate it into a wireframe (which admittedly is kind of backward), and lay out that wireframe using the bootstrap classes that most closely match the layout. From there, I iterate, to match the design proofs.
The designers don't use any bootstrap design, so the bootstrap styles never come through in the final product.
The "right way" to do it (which I don't do) would be to use LESS mixins, so as not to have Bootstrap classes polluting the source, but I mostly work on short-turnaround projects so I stick with the Bootstrap classes.
The right way is to use LESS mixins to match bootstrap classes with your semantic classnames.
I used the semantic mixins method quite a while, and let me say that it does not feel that good. Once you have your html full of nice "article-box" classes, who will ever notice?
If you strip completely your css from your markup to re-use it in another project, you're left with literally nothing, if not a bunch of semantic classes than then may also be semantically wrong in respect of the new project (has the article become a tutorial?).
Using bootstrap classes are a convention you can reuse in other projects, as well as override when you need. If you strip your css then, and replace it with a vanilla bootstrap, you'll get a halfway good looking page you can work on.
It's perfectly ok to pursue semantics, except that semantic class attributes are the most useless form of semantics.
In a time where angular and react challenged the very concepts of markup/behaviour/styling separation, after the utter failure of XHTML (the parsable markup nobody ever parsed) and the mild failure of HTML5 semantic tags (whose cases of use are confusing at most, and overlap dramatically with the arya attributes) I try to avoid to be too strict about semantics.
Projects that should not use bootstrap are the ones where every milisecond in performance truly matters, or when you have custom design requirements that would need major "overruling" of bootstrap. In this case, I recommend using a very lightweight CSS framework with a responsive grid instead, like http://purecss.io/grids/ .
http://motherfuckingwebsite.com/
For a project that required pretty heavy customization I ended up using skeleton/react (http://getskeleton.com/) and enjoyed it.
I saw Semantic UI on here the other day and I may end up trying that out on my next project: http://semantic-ui.com
Personally I would again choose bootstrap, if you have previous good experiences with it.
Bootstrap is made of several components, which make it trivial to recompile it without the not-needed parts. You can even do it online (as well as save/reuse configuration files): http://getbootstrap.com/customize/
The full bootstrap css weights 23.5kb gzipped. If you're not using gzip on your servers then that's the problem you should solve.
What makes bootstrap good is not the features per-se. It's the huge amount of cross-compatibility knowledge in it. There are many cool frameworks around, but it's hard to find something so solid and battle-proven as bootstrap. That's the real point of using bootstrap.