Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Fallback to non variant matches when no matching variant exists #178

Closed
wants to merge 3 commits into from

Conversation

thecrypticace
Copy link
Collaborator

Closes #71

Svelte’s dynamic class syntax looks like this:
<h1 class:text-blue-500={shouldBeBlue}></h1>

We were picking up class:text-blue-500 as a variant. However class is not a registered variant. In this case we were discarding the already matched rules for text-blue-500. In this case we want to match them anyway.

Svelte’s dynamic class syntax looks like this:
<h1 class:text-blue-500={shouldBeBlue}></h1>

We were picking up `class:text-blue-500` as a variant. However `class` is not a registered variant. In this case we were discarding the already matched rules for text-blue-500. In this case we want to match them anyway.
If multiple candidates resolved to the same rule the properties would get added more than once to the same rule.

For instance: class:text-blue-500 class1:text-blue-500 class2:text-blue-500 results in .text-blue-500 having the properties set 3 times.
@thecrypticace
Copy link
Collaborator Author

Closing since #183 was merged.

@adamwathan
Copy link
Member

Thanks though! ❤️

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

Successfully merging this pull request may close these issues.

Svelte's conditional class syntax is not picked up correctly
2 participants