S
S
sokira2019-10-30 14:22:16
Bootstrap
sokira, 2019-10-30 14:22:16

How to remove extra styles from Bootstrap 4 and reduce css size?

Minimum experience. I'm trying to make a project in laravel. To build the frontend, I use bootstrap 4.
I want to achieve the highest possible site loading speed.
1. Is there any algorithm that will help to throw out extra styles from bootstrap 4 that are not currently used in the project?
There are no more than 10 different page templates on the site.
2. Can it be automated?
With the development of the project, more standard bootsrap will be used, new page templates will appear. Is it possible to somehow automatically get a new truncated and compressed css?
In which direction should you dig?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Igor Vorotnev, 2019-10-30
@sokira

The easiest and most concrete way IMHO is to clean up unused CSS at the production build stage:
https://www.npmjs.com/package/postcss-remove-unused-css
https://github.com/uncss/postcss-uncss
https:/ /www.purgecss.com/with-postcss
etc

Y
Yaroslav Alexandrov, 2019-10-30
@alexyarik

Custom Bootstrap 4 scsss? there is no reception against scrap

A
Alexander Sharomet, 2019-10-30
@sharomet

So in scss disable everything you don't use

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question