4 ms·
Is Bootstrap 4 worth using if all you really want are the responsive utilities and classes? I'm aiming to make pages with less than 50KB of uncompressed CSS. I
by seanwilson 9y ago
Is Bootstrap 4 worth using if all you really want are the responsive utilities and classes? I'm aiming to make pages with less than 50KB of uncompressed CSS. I don't need all the components Bootstrap has but I find the responsive utilities and classes helpful.
- subbz 9y agoYou can strip off the things you don't need using SASS.
- gbuk2013 9y agoYou can pick and choose the parts of Bootstrap you want to use, but you'll need to compile the SCSS code (very easy). Assuming NPM install, look at node_modules/bootstrap/scss/bootstrap.scss for a list of files that are included and pick the ones you need and include them manually in your project's SCSS file. Here's a bit from my Makefile (because I love me some Make): SASS = ./node_modules/.bin/node-sass %.min.css: %.scss $(SASS) \ --output-style compressed \ --source-map true \ --source-map-contents true \ $< $@
- tannhaeuser 9y agoBit late, but it's probably easier to use just sassc (the standard SCSS compiler from the libsass project) rather than node-sass if you don't need node otherwise (for webpack or whatever) in your build pipeline. Node-sass as a native linked requires gyp, hence python, node, and a couple npm packages which add to your footprint considerably.
- dqv 9y agoIt's a very good builder library with a lot of useful SCSS utilities. You can pick and choose what you want to include in the final output.
- seanwilson 9y agoIt's worth doing this then? Given I'm going to be throwing away 80% of the CSS, I'm curious if there are better libraries I can build on top of. It's always an advantage that you'll be able to easily Google for Bootstrap fixes though.
- dqv 9y agoI'd say go ahead. The nice thing is that you can start with virtually nothing and if you realize later you need really nice widgets, then you can just use those mixins. Bootstrap is the only framework that looks nice, is responsive, and fully addresses accessibility. The only thing I can fault it for is using Jquery, but I don't use the javascript features, so it doesn't matter (to me) anyway.
- akmittal 9y agoYou can directly use flexbox or CSS grid now. It's not bad in CSS as it was before.