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

Improved variant ordering #759

Merged
merged 3 commits into from
Nov 19, 2022
Merged

Conversation

ben-rogerson
Copy link
Owner

@ben-rogerson ben-rogerson commented Nov 19, 2022

This PR fixes the ordering of variants on multi-variant classes:

tw`hover:[svg]:block`

// ↓ ↓ ↓ ↓ ↓ ↓

// Before
({ "svg:hover": { "display": "block" } });

// Now
({ ":hover svg": { "display": "block" } });

Thanks @u3u for the report which led me to look into this issue again - turned out an easy fix this time 🎉

The auto-parent selector then needed a couple tweaks:

  • Removed an error that asked us to add parent selectors
  • Included elements as a qualifier for a & (amp+space) prefix

I also fixed an error when non-media at-rules were used in arbitrary variants. (eg: [@page]:m-0)

@ben-rogerson ben-rogerson merged commit 02d7824 into master Nov 19, 2022
@ben-rogerson ben-rogerson deleted the bugfix/improved-variant-ordering branch November 19, 2022 22:35
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.

1 participant