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

Cleanup leftover layers #4853

Merged
merged 3 commits into from Jul 1, 2021
Merged

Cleanup leftover layers #4853

merged 3 commits into from Jul 1, 2021

Conversation

RobinMalfait
Copy link
Contributor

@RobinMalfait RobinMalfait commented Jul 1, 2021

When we create the context we also collect all the @layer nodes, cache them and remove them from the final stylesheet. However once you are in a running process the context will only be created once (as long as the dependencies don't change). Therefore the @layer nodes are not collected and removed anymore.

We already inject the correct contents (because we had it cached) but we didn't cleanup leftover @layer rules. This PR will make sure that we do that cleanup.

Whenever somebody changes the contents of an @layer, then one of the dependencies changed and a new context is created, therefore the new contents will be handled correctly.

Fixes: #4851

@RobinMalfait RobinMalfait changed the title cleanup leftover layers Cleanup leftover layers Jul 1, 2021
@adamwathan adamwathan merged commit f4ea2cf into master Jul 1, 2021
@adamwathan adamwathan deleted the cleanup-leftover-layers branch July 1, 2021 10:34
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.

@layer content is included in the compiled CSS incorrectly
2 participants