I go this working. I had to add the path to my prettier config in my .vscode/setttings.json file.
[Prettier Plugin]
Sorting with external plugins like Svelte, Astro, etc… not working when using Prettier v3
Astro extension doesn't use `prettier-plugin-tailwindcss` when formatting
Getting Astro to work with prettier-plugin-tailwindcss
Can I use other CSS frameworks with Astro?
Yes, Astro supports various CSS frameworks, and you can easily integrate them into your project using the same approach as we did with Tailwind CSS.
Can I customize the Prettier configuration to match my coding style?
Of course! Feel free to tweak the .prettierrc file to match your preferred coding style. You can find the full list of configuration options in the official Prettier documentation.
Can I use other JavaScript frameworks like React or Vue with Astro?
Absolutely! Astro supports several popular JavaScript frameworks, including React and Vue. To add them to your project, follow the same steps as we did for Svelte but with the appropriate framework integration.
» npm install prettier-plugin-tailwindcss
I just encountered this problem even though I had everything installed and setup correctly. It got resolved after reloading VS Code through "Command Palette (CTRL + SHIFT + P) > Reload Window". Hope this helps!
I encountered this problem too before. Though I just tried adding the Tailwind Prettier plugin to a new Remix project and everything seems to be working. Here are the steps I performed:
Installed Tailwind
npm install -D tailwindcss postcss autoprefixer concurrentlyAfter finishing all the steps outlined in the link above, I ran
npm install -D prettier prettier-plugin-tailwindcss
I don't have a prettier config file in place. I'm able to run Prettier through vscode and I can confirm that the Tailwind classes are automatically sorted.
Got into Tailwind last year when developing a personal project and ended up loving it, but disliked the utility class name bloat so I decided to make a VS Code formatter extension to prevent me from going insane. Hoping this helps anyone else out there with the same frustrations.
(Currently only JSX/TSX files supported, but I'm working on potential multi-language support for the next version. The code is open-source and can be found here: GitHub Repo)
Let me know if you find any bugs or issues. And if you liked the extension, please consider a rating/review, a star on the repo, or maybe even a sponsor :) or feel free to just share it around!
Tailwind Formatter Extension DemoExtension Link: https://marketplace.visualstudio.com/items?itemName=Myhtica.tailwind-formatter