Work with Tailwind official Prettier plugin #74
fabriciopirini
started this conversation in
Ideas
Replies: 1 comment
-
Thanks for the suggestion. Looked through the source code of the plug-in, it only activates on I recommend taking advantage of the multi argument support for sorting components. Although its more manual. See this guide: https://tw-classed.vercel.app/docs/guide/writing-clean-classed#organizing-your-classed-components Moving this to discussions |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
Not really, it would just be cool if we could add that to the workflow with this library too.
Describe the solution you'd like
Once I run Prettier, it would automatically sort the tailwind classes in the way it makes more sense and establish a certain pattern throughout the codebase.
Describe alternatives you've considered
So far, I've been doing it manually by creating a html element in the code and copying-pasting the classes to it, letting Prettier fix the order and copying-pasting it back to the
classed
call.Additional context
Here is the plugin page: https://tailwindcss.com/blog/automatic-class-sorting-with-prettier
and its repo: https://github.com/tailwindlabs/prettier-plugin-tailwindcss
Not sure how to even start this since it seems like it is very "tied" to the HTML structure and the class attributes but maybe we could figure something out.
Beta Was this translation helpful? Give feedback.
All reactions