Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Remove unused @property rules #1325

Open
1 task done
filipsobol opened this issue Feb 15, 2025 · 0 comments
Open
1 task done

[Bug]: Remove unused @property rules #1325

filipsobol opened this issue Feb 15, 2025 · 0 comments
Labels

Comments

@filipsobol
Copy link

filipsobol commented Feb 15, 2025

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant