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

Use Tailwind's context.getClassOrder(classes) #57

Merged
merged 5 commits into from Feb 21, 2022

Conversation

RobinMalfait
Copy link
Contributor

@RobinMalfait RobinMalfait commented Feb 10, 2022

This PR will use Tailwind's exposed context.getClassOrder(classes) function instead. This will allow us to have some special cases in Tailwind itself (e.g.: group and peer). But it will also make sure that the actual sorting logic stays in this plugin.

Tailwind will just expose the information required to be able to sort classes correctly. When classes are unknown, the sort order will be set to null.

Fixes: #53

We have to keep the existing code for now, since the plugin will prefer
the user's tailwind version. Hopefully we can remove this in future
versions.
@RobinMalfait RobinMalfait changed the title Use Tailwind's context.sortClassList(classes) Use Tailwind's context.getClassOrder(classes) Feb 16, 2022
This will also add the `group` and `peer` for older versions of Tailwind
CSS
@bradlc bradlc merged commit 90f6536 into main Feb 21, 2022
@bradlc bradlc deleted the use-tailwind-sortclasslist branch February 21, 2022 18:23
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.

group is sorted before custom classes
2 participants