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

Only check selectors containing apply candidates for circular dependencies #8222

Merged

Conversation

thecrypticace
Copy link
Contributor

When given a two rule like html.dark .a, .b { … } and html.dark .c { @apply b } we would see .dark in both the base rule and the rule being applied and consider it a circular dependency. However, the selectors html.dark .a and .b should be considered on their own and as a result not introduce a circular dependency.

This better matches the user’s mental model that the selectors are just two definitions sharing the same properties.

Fixes #7844

@thecrypticace thecrypticace force-pushed the fix/apply-circular-dectection-for-multiple-selectors branch from 4ab2a7f to 6c1b009 Compare April 28, 2022 15:57
@thecrypticace thecrypticace changed the title Only check selectors containing base apply candidates for circular dependencies Only check selectors containing apply candidates for circular dependencies Apr 28, 2022
…pendencies

When given a two rule like `html.dark .a, .b { … }` and `html.dark .c { @apply b }` we would see `.dark` in both the base rule and the rule being applied and consider it a circular dependency. However, the selectors `html.dark .a` and `.b` are considered on their own and is therefore do not introduce a circular dependency.

This better matches the user’s mental model that the selectors are just two definitions sharing the same properties.
@thecrypticace thecrypticace force-pushed the fix/apply-circular-dectection-for-multiple-selectors branch from 6c1b009 to 3f38cab Compare May 2, 2022 15:08
@thecrypticace thecrypticace merged commit 7c337f2 into master May 2, 2022
@thecrypticace thecrypticace deleted the fix/apply-circular-dectection-for-multiple-selectors branch May 2, 2022 15:11
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.

@apply rule cannot pick up grouped utility css selector
1 participant