Skip to content

Conversation

@RobinMalfait
Copy link
Member

@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
@RobinMalfait RobinMalfait force-pushed the cleanup-leftover-layers branch from 07d93e2 to 5bd2425 Compare July 1, 2021 10:22
@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

3 participants