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

Recursively collapse adjacent rules #7565

Merged
merged 2 commits into from
Feb 21, 2022

Conversation

thecrypticace
Copy link
Contributor

We collapse adjacent rules and media queries automatically. This is because of the way @apply works by generating a Rule/AtRule for every class in an apply. However, when given something like @apply md:text-black md:bg-white we would not collapse the rules inside the media query. This isn't strictly necessary but it would result in a bit of a win with smaller generated CSS if you're using @apply.

I refactored a bit to collapse adjacent rules at the top level and then find all at rules and collapse their children recursively until there's nothing left to collapse.

Fixes #4896

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicated CSS rules in @media output
1 participant