A Prettier plugin for sorting Tailwind CSS v4 classes in Latte v3 templates (Nette framework). Current stable version is 0.6.0, released March 2025. It fills the gap left by the official prettier-plugin-tailwindcss which does not support Latte. Key differentiators: handles n:class, class={[...]} Latte array syntax, custom classRegex for {embed}/{include} parameters, and a barrier model for n:class whitespace. Ships TypeScript types. Requires prettier >=3.0.0 and @tailwindcss/node >=4.0.0. Options include tailwindStylesheet, tailwindClassOrder (bucket-based ordering introduced in 0.6.0), tailwindPropertyOrder, and tailwindPreserveWhitespace. Active development with regular releases.
npm install prettier-plugin-latte-tailwindcssVerified import paths — ran on the pinned version, not inferred.
Minimal .prettierrc config to enable sorting Tailwind classes in Latte templates, with install command and before/after example.
Run: npm install -D @tailwindcss/node@latest
Uninstall old package: npm uninstall prettier-plugin-latte-tailwind, then install new: npm install -D prettier-plugin-latte-tailwindcss. Update .prettierrc plugins array.
No fix needed; you can remove the option from config if you're using the default.
Upgrade Node.js to v20.19 or later (or use nvm to switch).
Set tailwindStylesheet to your project's CSS entry point (e.g., './resources/css/app.css').
Use separate string literals or single classes in n:class arrays to get them sorted.
Run: npm install -D prettier-plugin-latte-tailwindcss (in your project directory). Ensure your working directory contains node_modules.
Install: npm install -D @tailwindcss/node@>=4.0.0
Add to .prettierrc: overrides: { files: '*.latte', options: { parser: 'latte' } }npm install -D @tailwindcss/node@latest