Questions tagged [css-purge]

A CSS tool written in Node JS as a command line app or library for the purging, burning, reducing, shortening, compressing, cleaning, trimming and formatting of duplicate, extra, excess or bloated CSS.

More information here: https://www.npmjs.com/package/css-purge

90 questions
2
votes
1 answer

Nuxtjs + Vuetify + Purgecss

Seeing as Vuetify adds around 300-340kb worth of icons when using icons: 'mdi' with the nuxt@vuetify-module, I've found answers indicating that purgeCSS is a good solution to shave off the unnecessary and unused icons. I initially imported the icons…
Thorvald
  • 546
  • 6
  • 18
2
votes
0 answers

How to Purge CSS with Wordpress, Tailwind and Gutenberg

I'm using Laravel Mix with Tailwind CSS included into a theme for Wordpress. A part of my tailwind config: future: { removeDeprecatedGapUtilities: true, purgeLayersByDefault: true, }, purge: { content: [ '*.php', …
Marek123
  • 1,193
  • 7
  • 35
  • 75
2
votes
1 answer

PurgeCSS misses Tailwind classes that use a colon:

I have a website that uses tailwind. I'd like to keep the css size small, so I decided to use purgecss. I'm building the static site with python, so I'd like to use the CLI. Here's the code in my Makefile that handles this. NODE_ENV=production npx…
cantdutchthis
  • 31,949
  • 17
  • 74
  • 114
2
votes
0 answers

Tailwind dose not provide the rejected/purged style list when using the `rejected` option of purgecss

in my project I am using nuxtjs with tailwind and I need somehow to get the purged style. I tried to use the rejected option of purgecss (https://purgecss.com/configuration.html#options), but don't know where to get the…
Majd Sy
  • 21
  • 2
2
votes
0 answers

Laravel Mix and PurgeCss chain, not purging specified file after mix.copy

Trying to build out specific purgedCSS files for a project with rather large complete CSS file. However PurgeCSS refuses to only purge the specified file after mix.copy(), and still purges the main app.css file. mix.sass('resources/sass/app.scss',…
cee.e
  • 159
  • 1
  • 1
  • 9
2
votes
0 answers

Correctly define Angular Material theme Angular 11 with PurgeCSS

I recently upgraded to Angular 11 and I have integrated in my process the PurgeCSS plugin https://purgecss.com/ which works fine. Now I'm integrating Angular Material 11 and I'd like to customize the theme. Following the steps from here:…
Carlos Torrecillas
  • 4,965
  • 7
  • 38
  • 69
2
votes
0 answers

PurgeCSS CLI Won't Output CSS Outside of the Command Line

I'm having a hard time trying to extract my css using purgecss from a command line to a separate file. The instruction on the PurgeCSS.com for using the commandline are not specific enough: By default, the CLI outputs the result in the console. If…
ChosenJuan
  • 891
  • 3
  • 26
  • 56
2
votes
1 answer

Is there any way to use purgecss on php files?

I have a project where I'm not using any framework or template engine, just plain php. I came across this PurgeCSS plugin that I would like to try as all the pages in the project follow a very similar theme and I think are not using much css rules…
Akash Sarode
  • 387
  • 2
  • 13
2
votes
1 answer

Using classnames with purgecss

I am using classnames with purgeCSS and Webpack. Apparently PurgeCSS can't handle those classnames itself. How can I implement an extractor that filters classnames defined in the classnames() function? my webpack.config.js is in the answers as I…
2
votes
2 answers

TailwindCSS build css file too big even after PurgeCSS

In my create-react-app application I'm using Tailiwnd CSS for styling. Unfortunately after running npm run build the css file size is around 1,4mb which is way too big. After looking inside that build file I can see that all unused class are still…
maaajo
  • 839
  • 6
  • 10
1
vote
0 answers

Better Tailwind / PurgeCSS extractor for Angular?

I'm working on an Angular 15 app, and looking into integrating Tailwind 3 into it. First of all, I'm not a huge fan of "utility-first" css libs, but I do see some use cases where it could come in handy. Mostly to standardise all of the…
ZolaKt
  • 4,683
  • 8
  • 43
  • 66
1
vote
0 answers

How do I use purgecss, react, css-module in the vite 4.x project?

How do I use purgecss, react, css-module in the vite 4.x project? I used @ fullhuman/postcss-purgecss, but I found it can't be used with css-module. Then I tried: { "scripts": { "postbuild": "purgecss --css build/static/css/*.css --content…
1
vote
0 answers

Is it possible to remove unused CSS in JS files that Angular generates?

I have an Angular application with a lot of CSS. Most of this is written at the component level. I know that Angular writes the CSS inside the output bundle. Is it possible to remove unused CSS in this JS file? After I try purgecss I found that it…
Jon Sud
  • 10,211
  • 17
  • 76
  • 174
1
vote
0 answers

purgecss + react-semantic-ui + nextjs

I have a problem of using purgecs in order to remove unused css (need for performance improvements). The problem is that purge css deletes css styles i don't wanna be deleted. Maybe somebody can share some good build of this combination of…
1
vote
0 answers

Purge css with certain prefix or from certain file

I am exploring the purge CSS plugin (https://github.com/FullHuman/purgecss) and I found there is a safelist for certain selectors that we don't want to remove. But, I want to remove only those CSS that start with certain prefixes and keep everything…
Hasan Mobarak
  • 133
  • 2
  • 12