#1325·purgecss

[Bug]: Remove unused `@property` rules

Author: filipsobolCreated Feb 15, 2025Updated Feb 15, 2025
Labelsbug

Describe the bug

With the variables: true configuration option, PurgeCSS can remove unused variables declared like this:

css
:root {
  --tw-rotate-x: rotateX(0);
}

However, it doesn't remove the fairly recently introduced @property rule like this:

css
@property --tw-rotate-x-2 {
  syntax: '*';
  inherits: false;
  initial-value: rotateX(0);
}

To Reproduce

  1. Go to https://stackblitz.com/edit/vitejs-vite-ogqm14x7?file=style.css&terminal=build
  2. Wait for the build to finish or run npm run build in the terminal.
  3. Inspect the CSS file in the dist/assets folder.

Expected Behavior

CSS variables declared using @property should be removed

Environment

N/A

Add any other context about the problem here

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct