diff --git a/site/content/docs/4.3/customize/optimize.md b/site/content/docs/4.3/customize/optimize.md index 8a3b7e2be37c..eea4a7a3b86f 100644 --- a/site/content/docs/4.3/customize/optimize.md +++ b/site/content/docs/4.3/customize/optimize.md @@ -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.