Jump to content

strip unused CSS


webhoes
 Share

Recommended Posts

Hello,

Is there a way or online website that can crawl my website and create a new CSS of only classes dat are used?

I currently have CSS file (from themeforest) that contains a lot of unused CSS. I want to strip the unused CSS to create a smaller file.

Same also for the js files.

Any thoughts?

Link to comment
Share on other sites

Hi,
you can use PurgeCss for this, you'll need to install postcss and follow some steps in order to make it function.
Take a look at this post, you can have an idea on how purgecss works, even if you are not interested in using tailwindcss.

I don't think there is something similar for javascript, rather than minification. You'll need to understand which elements rely on which js and then remove the useless parts by hand.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...