Fix generation of div:not(.foo) if .foo is never defined
#7815
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
This PR will fix an issue where some code never got generated.
E.g.:
You would expect that this
divhas a background color ofpink, but that's not the case because we never generated the above css. This is because it contains a class that doesn't exist and therefore we never generated it.It could happen that you forget about this code, and all of a sudden you use
.fooin an unrelated spot. This means that all of a sudden this code doess get generated and now your div is pink.This PR will fix that by making sure that this gets generated. We already generate non "on-demandable" code (always). For example
div {}will always be generated.To fix this, we ignore everything inside the
:notwhen extracting classes, this results indiv {}and doesn't contain any classes thus we generate it. Note, removal of:not()only happens when extract classes, the final result still contains the:not.Fixes: #7750