Skip to content

[Bug]: Remove unused @property rules #1325

@filipsobol

Description

@filipsobol

Describe the bug

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

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

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

@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions