Prettier plugin for sorting Tailwind CSS classes in tailwind-styled-components template literals. Current stable version 2.0.2 (Feb 2026), requires Node >=20.19 and Prettier ^3.0. Built on top of the official prettier-plugin-tailwindcss, it extends class sorting to tagged template literals used by tailwind-styled-components. Supports Tailwind CSS v3 and v4, custom tailwindConfig/tailwindStylesheet paths, duplicate class preservation, and custom function names. ESM-only; no CJS support. Release cadence: irregular, with breaking changes in v2.0 (made tailwind-styled-components optional peer dep).
npm install prettier-plugin-tailwind-styled-componentsVerified import paths — ran on the pinned version, not inferred.
Install the plugin, configure .prettierrc with both plugins (order matters), and format a tailwind-styled-components tagged template literal.
Run `npm install -D tailwind-styled-components react react-dom` if you use tailwind-styled-components.
Upgrade to Tailwind CSS v3+ or stay on v0.x.
Remove `tailwindConfig` and add `"tailwindStylesheet": "./path/to/app.css"`.
Ensure `prettier-plugin-tailwind-styled-components` appears after `prettier-plugin-tailwindcss`.
Ensure your project uses ESM (e.g., `type: "module"` in package.json) or use Prettier CLI with `--config`.
Set `"tailwindPreserveDuplicates": true` in .prettierrc.
Run `npm install -D prettier-plugin-tailwindcss prettier-plugin-tailwind-styled-components`.
Either remove the option or use `tailwindConfig` for Tailwind v3.
Upgrade Prettier to v3+ (`npm install -D prettier@^3`).