I go this working. I had to add the path to my prettier config in my .vscode/setttings.json file.

🌐
GitHub
github.com › tailwindlabs › prettier-plugin-tailwindcss
GitHub - tailwindlabs/prettier-plugin-tailwindcss: A Prettier plugin for Tailwind CSS that automatically sorts classes based on our recommended class order. · GitHub
prettier-plugin-astro · prettier-plugin-css-order · prettier-plugin-jsdoc · prettier-plugin-multiline-arrays · prettier-plugin-organize-attributes · prettier-plugin-organize-imports · prettier-plugin-svelte · prettier-plugin-sort-imports · One limitation with this approach is that prettier-plugin-tailwindcss must be loaded last.
Starred by 7.1K users
Forked by 176 users
Languages   TypeScript 97.6% | JavaScript 2.4%
🌐
Astro
docs.astro.build › en › editor-setup
Editor setup - Astro Docs
Optionally, install other Prettier plugins for your project, and add them to the configuration file. These additional plugins may need to be listed in a specific order. For example, if you use Tailwind, prettier-plugin-tailwindcss must be the last Prettier plugin in the plugins array.
Discussions

[Prettier Plugin]
I've got a project using Astro. I have prettier 3.5.3 set up and it's working as expected on .astro files for TS and HTML formatting. I'd like to use the prettier-plugin-tailwindcss to ... More on github.com
🌐 github.com
3
1
Sorting with external plugins like Svelte, Astro, etc… not working when using Prettier v3
What version of prettier-plugin-tailwindcss are you using? v0.4.1 What version of Tailwind CSS are you using? v3.3.3 What version of Node.js are you using? v18.16.1 What package manager are you usi... More on github.com
🌐 github.com
30
July 19, 2023
Astro extension doesn't use `prettier-plugin-tailwindcss` when formatting
Is this a configuration problem, or is it an issue with the Astro extension? ... A Prettier plugin for Tailwind CSS that automatically sorts classes based on our recommended class order. - GitHub - tailwindlabs/prettier-plugin-tailwindcss: A Prettier plugin for Tailwind CSS tha... More on answeroverflow.com
🌐 answeroverflow.com
March 5, 2023
Getting Astro to work with prettier-plugin-tailwindcss
I can't for the life of me get the Tailwind plugin to work with Astro files in VS Code. I've tried several approaches I've found online, including the guide linked from the Astro website: https://straffesites.com/en/blog/integrate-prettier-astro-tailwindcss Has anyone had success getting this ... More on answeroverflow.com
🌐 answeroverflow.com
September 19, 2023
People also ask

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.

🌐
straffesites.com
straffesites.com › en › blog › astro setup svelte tailwindcss vercel prettier typescript
Astro setup: Svelte, Tailwind CSS, Vercel, Prettier & TypeScript ...
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.

🌐
straffesites.com
straffesites.com › en › blog › integrate prettier astro tailwindcss
Integrate Prettier with Astro & Tailwind CSS for Cleaner Code - ...
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.

🌐
straffesites.com
straffesites.com › en › blog › astro setup svelte tailwindcss vercel prettier typescript
Astro setup: Svelte, Tailwind CSS, Vercel, Prettier & TypeScript ...
🌐
Web Reaper
webreaper.dev › posts › astro-prettier-tailwind-setup
Setup Astro 3.0 with Tailwind CSS Prettier Plugin
September 9, 2023 - Save time and eliminate styling discussion with auto-formatting and tailwind auto-class-ordering on save by setting up Prettier for Tailwind CSS in your Astro 3.0 projects.
🌐
Straffesites
straffesites.com › en › blog › integrate prettier astro tailwindcss
Integrate Prettier with Astro & Tailwind CSS for Cleaner Code - Straffe Sites
December 4, 2024 - npx astro add tailwindcss npm install prettier prettier-plugin-astro prettier-plugin-tailwindcss
🌐
Astro Tips
astro-tips.dev › tips › prettier
Setting up Prettier | Astro Tips
When using the Tailwind CSS integration, there is another dev dependency for automated class sorting: prettier-plugin-tailwindcss.
🌐
Straffesites
straffesites.com › en › blog › astro setup svelte tailwindcss vercel prettier typescript
Astro setup: Svelte, Tailwind CSS, Vercel, Prettier & TypeScript - Straffe Sites
December 4, 2024 - Welcome to this guide on setting up an Astro project that utilizes Svelte, Tailwind CSS, Vercel, Prettier, and TypeScript. By the end of this post, you'll have a fully configured and efficient Astro project that follows best practices and is ready for production. Let's get started! Astro setup: Svelte, TailwindCSS, Vercel, Prettier and TypeScript
Find elsewhere
🌐
GitHub
github.com › tailwindlabs › prettier-plugin-tailwindcss › issues › 186
Sorting with external plugins like Svelte, Astro, etc… not working when using Prettier v3 · Issue #186 · tailwindlabs/prettier-plugin-tailwindcss
July 19, 2023 - The problem is that the tailwind classes are not being sorted, even though the prettier-plugin-svelte is functioning correctly for other formatting aspects like tabs, quotes, and empty lines. Tailwind config is located in in the root folder, along with the rest of the configs, Prettier debug output does not give explicit reasons. I have tried to reinstall dependencies, restart the VSCode, Both the "format on save" option and the npx prettier --write .
Author   GeoGeorgeous
🌐
npm
npmjs.com › package › prettier-plugin-tailwindcss
prettier-plugin-tailwindcss - npm
December 1, 2025 - prettier-plugin-astro · prettier-plugin-css-order · prettier-plugin-jsdoc · prettier-plugin-multiline-arrays · prettier-plugin-organize-attributes · prettier-plugin-organize-imports · prettier-plugin-svelte · prettier-plugin-sort-imports · One limitation with this approach is that prettier-plugin-tailwindcss must be loaded last.
      » npm install prettier-plugin-tailwindcss
    
🌐
R44J
r44j.dev › home › blog › beginner's guide to setting up astro: astro + prettier + eslint + tailwind css
Effortless Code Styling: Configuring Astro with Prettier, ESLint, and Tailwind CSS
March 3, 2024 - In the image above, you can observe ... the index.astro file for our h1 tag. Install the prettier extension on VS Code, and use the following command to install prettier packages · If you haven't installed tailwind css, you can skip adding prettier-plugin-tailwindcss....
🌐
Reinhardpoetz
reinhardpoetz.com › a › set-up-astro-with-tailwind-and-prettier
Set up Astro with Tailwind and Prettier | Reinhard Pötz
September 1, 2023 - { "prettier": { "printWidth": 120, "semi": false, "singleQuote": true, "bracketSpacing": false, "plugins": [ "prettier-plugin-astro", "prettier-plugin-tailwindcss" ] } }
🌐
Lightrun
lightrun.com › answers › tailwindlabs-prettier-plugin-tailwindcss-incompatibility-with-other-prettier-plugins
Incompatibility with other Prettier plugins
For Astro users, this new release supports prettier-plugin-astro, which you can install in the same way. We’ve released this updated plugin as a beta version since we’re not 100% sure on this approach quite yet, and would really appreciate your help testing it out. You can install it using the beta tag: npm install prettier-plugin-tailwindcss@beta ·
🌐
Answer Overflow
answeroverflow.com › m › 1081950205626298368
Astro extension doesn't use `prettier-plugin-tailwindcss ...
March 5, 2023 - { plugins: [ require.resolve("prettier-plugin-astro"), require.resolve("prettier-plugin-tailwindcss"), // last ], pluginSearchDirs: false, } And formatting with Prettier CLI works:
🌐
Answer Overflow
answeroverflow.com › m › 1153838557769764874
Getting Astro to work with prettier-plugin-tailwindcss - Kevin Powell - Community
September 19, 2023 - I can't for the life of me get the Tailwind plugin to work with Astro files in VS Code. I've tried several approaches I've found online, including the guide linked from the Astro website: https://straffesites.com/en/blog/integrate-prettier-astro-tailwindcss Has anyone had success getting this ...
🌐
GitHub
github.com › tailwindlabs › tailwindcss › discussions › 11836
I can't get prettier to work on my Astro site [Prettier Plugin] · tailwindlabs/tailwindcss · Discussion #11836
module.exports = { plugins: ['prettier-plugin-astro', 'prettier-plugin-tailwindcss'], tailwindConfig: './tailwind.config.cjs' }
Author   tailwindlabs
🌐
Danielnewton
danielnewton.dev › blog › astro-tailwind-prettier-formatting
Astro & Tailwind CSS: Perfectly Formatted with Prettier
June 5, 2025 - Without proper sorting, the order ... and maintain. prettier-plugin-tailwindcss is a plugin that automatically sorts classes in the same order that Tailwind orders them in your CSS....
🌐
Tailwind CSS
tailwindcss.com › blog › automatic-class-sorting-with-prettier
Automatic Class Sorting with Prettier - Tailwind CSS
The plugin will respect your tailwind.config.js file and work with any Tailwind plugins you've installed, but there is no way to change the sort order. Just like with Prettier, we think that the benefits of auto-formatting will quickly outweigh any stylistic preferences you have and that you'll get used to it pretty fast.
🌐
Reddit
reddit.com › r/tailwindcss › vs code extension for formatting tailwind classes (jsx/tsx)
r/tailwindcss on Reddit: VS Code Extension for Formatting Tailwind Classes (JSX/TSX)
March 20, 2025 -

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 Demo

Extension Link: https://marketplace.visualstudio.com/items?itemName=Myhtica.tailwind-formatter

🌐
Nova Extensions
extensions.panic.com › extensions › stonerl › stonerl.prettier
Prettier⁺ | Nova Extensions - Panic
The Swiss Army knife for formatting — fast, reliable, and built on Prettier. ... The Swiss Army knife for code formatting — seamlessly format JavaScript, TypeScript, JSON, CSS, HTML, Markdown, and more in Nova, with built-in support for Astro, EJS, Java, Laravel Blade, Liquid, PHP, SQL, Tailwind CSS, TOML, Twig, and XML — no extra setup required.