tailwindlabs/prettier-plugin-tailwindcss

reordering doesn't respect backets when there is a space

fcrozatier opened this issue · 2 comments

See the following video, where

<span class="before:sr-only before:content-['hello there'] bg-green-100"></span>

is formatted as

<span class="there'] bg-green-100 before:sr-only before:content-['hello"></span>
Enregistrement.de.l.ecran.2024-04-09.a.11.10.35.mov

What version of prettier-plugin-tailwindcss are you using?

"prettier-plugin-tailwindcss": "^0.5.13",

What version of Tailwind CSS are you using?

"tailwindcss": "4.0.0-alpha.13"

What version of Node.js are you using?

v20.11.0

What package manager are you using?

pnpm

What operating system are you using?

macOS

Hey!

This is a limitation to how classes work in HTML, you can't have spaces because each space is a delimiter for a new class. If you want to use spaces, you can use an _ which we replace with a space.

More info: https://tailwindcss.com/docs/content#using-spaces-and-underscores

Hope this helps!

Oh thank you!