Reputation: 1
I am searching what to use as a Sass mixin library: Bootstrap or rather Bourbon.
I found that Bootstrap is more like UI frameworks and you are getting out of the box components and modules. And Bourbon is actually Sass library which gives you set of tools for writing SCSS so you can create easily your own components and modules.
I am wondering how convenient is Bootstrap to be used as a mixin library?
I tried to write code for buttons on my site with Bootstrap mixins, and I had to change almost every mixin for buttons to get my look of buttons. And I had to delete a lot of predefined code.
In Bourbon I used some general mixins and write some new ones.
I assume that in Bootstrap there will be a lot of deleting and overriding.
Can someone give me pros and cons from their experience?
Upvotes: -3
Views: 250
Reputation: 1
I can't speak for Bootstrap4, but Bootstrap3's bootstrap-sass doesn't seem to be built in with mixins in mind. A bunch are used in the modules themselves and can possibly be useful when defining styles, but they are by no means the intended workflow. The case seems to be the same with the original LESS source.
You can carve out chunks you don't need, but compared to Bourbon's zero output on installation policy you're usually better off overriding a few properties with a tiny stylesheet loaded after a minified bootstrap hotlinked from cdn. You can certainly optimize it to an extent, but it won't be pretty.
For instance, properly setting up the variables to style a navbar and importing bootstrap's relevant parts along with their dependencies gets you at ~35k uncompressed. Or you can override just the parts you need for 2-3k and let your end user eat the 110k minified full bootstrap from a content delivery network. They will already have it cached, because it is so popular, is the conventional argument.
This whole hotlinking and fitting markup to styles instead of the other way around has raised some criticism, but apparently it's the way bootstrap is designed to be used.
Overall, if you're already comfortable with Bourbon, checking out Bootstrap3 might be interesting to pick up a few tricks, but it is definitely not a mixin library.
Upvotes: 0