New Check out the curated list of the finest design resources I've gathered for you! Take a look →

How to Use Prepros for Purging CSS

Are you looking to optimize your CSS files by removing unused styles? Using PurgeCSS with Prepros can help you achieve this. In this article, we will walk you through the steps to effectively purge your CSS using Prepros.

Successfully use Prepros for purging CSS files

1. Install PurgeCSS in Prepros

First, navigate to the packages section within Prepros. Search for PurgeCSS and install it in your Prepros environment. This step is crucial in order to access the PurgeCSS functionality within Prepros.

Prepros for Purging CSS

2. Set Up Custom Command

Access the project settings in Prepros and go to the CSS Tools section. Add a custom command within the task settings.

purgecss --css {{input}} --content "{{rawRootDir}}/*.html" --output {{outputDir}} {{output}}

This custom command will allow you to execute the PurgeCSS functionality on your CSS files within Prepros by scan *.html files.

3. Purging CSS

Locate the CSS files that you want to purge within Prepros. Check the custom command that you set up in the previous step. Click on the process file button to initiate the purging process. Once completed, review the results to see the optimized CSS files without any unused styles.

By following these steps, you can efficiently purge your CSS files using Prepros and optimize your website’s performance by reducing unnecessary styles.

Rizwan Aritonang

An independent WordPress & Front-End Developer from Bandung, Indonesia.

Get In Touch

Leave a Comment