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

Match sorting rules to tailwind prettier plugin #76

Merged
merged 4 commits into from
Aug 1, 2023

Conversation

praveenperera
Copy link
Member

@praveenperera praveenperera commented Jul 9, 2023

Closes: #75

@Cretezy @tobimori can you help me test this, you can build locally by running ./local-release

To get this working you need to run it with --output-css-file=<PATH TO OUTPUT CSS FILE> to point to the final css file generated by tailwind css.

@praveenperera praveenperera changed the title Sort using the order in the output css file Match sorting rules to tailwind prettier plugin Jul 9, 2023
@tobimori
Copy link

tobimori commented Jul 9, 2023

One thing to keep in mind:
There are certain setups where it's impossible to have an output file in development mode, e.g. using Vite. Vite's assets are usually available under a certain web address, generated on demand, not on the file system. Can you implement a way to fetch a remote resource for the sort order?

@praveenperera
Copy link
Member Author

@tobimori if this works yes I can do that later, but one step at a time

@tobimori
Copy link

tobimori commented Jul 9, 2023

@tobimori if this works yes I can do that later, but one step at a time

Can't test it without - sorry, I only use Tailwind together with Vite.

@praveenperera
Copy link
Member Author

praveenperera commented Jul 9, 2023

@tobimori can you do a production build so it spits out a css file just to test it out?

@praveenperera praveenperera merged commit 83cbb0f into master Aug 1, 2023
29 checks passed
@praveenperera praveenperera deleted the output-css-sorter branch August 1, 2023 20:12
@praveenperera
Copy link
Member Author

@tobimori I ran vite and it shows the location of css file

Screenshot 2023-08-11 at 12 53 03 PM

@tobimori
Copy link

This is the source file (which doesn't contain the class order)

@praveenperera
Copy link
Member Author

@tobimori I added support for vite: https://github.com/avencera/rustywind/releases/tag/v0.18.0

rustywind --vite-css <PATH> .

@tobimori
Copy link

thanks! i'm on vacation right now but will test it asap 😍

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.

Use same sort order as official Prettier plugin
2 participants