[Update] This bug has been fixed in Tailwind v3.4.2.
An example repository to show inconsistent sorting using Prettier with Tailwind plugin.
Running the Prettier --write command produces different result when specifying a file vs running Prettier on all files. Therefore, after saving and formatting a file in VS Code, the Prettier format check on all files using CLI fails.
pnpm install
pnpm prettier --write "test.html" --config prettier.config.mjs
(or pnpm format-file
)
Produces the following result:
<div class="before:[mask-image:--variable] before:[mask-size:contain]"></div>
pnpm prettier --write . --config prettier.config.mjs
(or pnpm format-all
)
Produces the following result:
<div class="before:[mask-size:contain] before:[mask-image:--variable]"></div>