Skip to content

Commit

Permalink
Fill in some unusedcss section links
Browse files Browse the repository at this point in the history
  • Loading branch information
mdo authored and olsza committed Oct 3, 2020
1 parent c58ec55 commit 6a61952
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion site/content/docs/4.3/customize/optimize.md
Expand Up @@ -37,10 +37,17 @@ This way, you're not including any JavaScript you don't intend to use for compon

Bootstrap depends on Autoprefixer to automatically add browser prefixes to certain CSS properties. Prefixes are dictated by our `browserslist.rc` file, found in the root of the Bootstrap repo. Customizing this list of browsers and recompiling the Sass will automatically remove some CSS from your compiled CSS, if there are vendor prefixes unique to that browser or version.

## Use Purge CSS
## Unused CSS

_Help wanted with this section, please consider opening a PR. Thanks!_

While we don't have a prebuilt example for using [PurgeCSS](https://github.com/FullHuman/purgecss) with Bootstrap, there are some helpful articles and walkthroughs that the community has written. Here are some options:

- https://medium.com/dwarves-foundation/remove-unused-css-styles-from-bootstrap-using-purgecss-88395a2c5772
- https://lukencode.com/2018/07/29/automatically-removeunused-css-from-bootstrap-or-other-frameworks/

Lastly, this [CSS Tricks article on unused CSS](https://css-tricks.com/how-do-you-remove-unused-css-from-a-site/) shows how to use PurgeCSS and other similar tools.

## Minify and gzip

Whenever possible, be sure to compress all the code you serve to your visitors. If you're using Bootstrap dist files, try to stick to the minified versions (indicated by the `.min.css` and `.min.js` extensions). If you're building Bootstrap from the source with your own build system, be sure to implement your own minifiers for HTML, CSS, and JS.
Expand Down

0 comments on commit 6a61952

Please sign in to comment.