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

added support for sorting variant based classes as well #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tirthGajjar
Copy link

closes #131

@praveenperera
Copy link
Contributor

praveenperera commented Jun 13, 2021

Hey @tirthGajjar, thanks for this, looks great. Could you add a test for it?

Also how did you decide on that order?

@tirthGajjar
Copy link
Author

@praveenperera Thanks, I will add the test cases.

About the proposed order or variants, Tailwind team suggests specific order when stacking varaints for a single classname, to make everything work.
https://tailwindcss.com/docs/configuration#variant-order
https://tailwindcss.com/docs/dark-mode#stacking-with-other-variants

I just used this order to sort multiple classes, plus it looked a little more organized.

@praveenperera
Copy link
Contributor

Sounds good, there is also an empty variant in the master branch file should we add that too? https://github.com/tailwindlabs/tailwindcss/blob/master/stubs/defaultConfig.stub.js#L807-L823

Also does this sort stacked variants or just based on the first variant? I think it would be okay to just sort on the first variant.

@tirthGajjar
Copy link
Author

Yes, It sorts based on the stacked variants.
Sure I will make the final changes and update in 2 days.

@danestves
Copy link

Any updates about this?

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.

Support first and last child utilities
3 participants