Bootstrap5 as a module package or precompiled CSS by Bootstrap?


I want to develop a bootstrap theme from scratch.

And I wonder if it is better to integrate Bootstrap5 it in my project with the precompiled CSS by the Bootstrap page:

or is it recommended to integrate Bootstrap via HUGO module package:
GitHub - gohugoio/hugo-mod-bootstrap-scss: Packages Bootstrap SCSS (v4 and v5) as a Hugo Module ?

Is it correct that the module on GitHub uses Bootstrap 5.0.2 while the current Bootstrap version is 5.2.0?


Don’t add the full pre-compiled Bootstrap. Have a look in my repo for how I do it. I add Bootstrap via Node package, then load only the parts that I need and work excessively with the recently introduced CSS variables of Bootstrap.

If you use the linked module then run hugo mod get -u ./... in your project root to update to the latest Bootstrap. Yes, use 5.2, it’s much better than 5.0 (CSS variables were introduced in 5.2).

PS: CSS creation is handled by my hugo-head module, see here.

With the precompiled CSS, you’re getting everything in Bootstrap, which adds a ton of weight to your site.

The Hugo module or Node package makes it easier to add Bootstrap’s SASS files and only enable the Bootstrap features you need. I use the Hugo module on my site because I didn’t want to add another package manager (NPM) just for a styling framework.

1 Like

Super, thank you very much for the fast answers!
Have a great day!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.