Closed velin-deity closed 5 months ago
This plugin intentionally sorts classes in @apply
blocks, removes duplicate tailwind classes, and removes whitespace.
That said, if you want to keep whitespace in CSS files but not everywhere else you can configure Prettier to do that by adding an overrides key:
{
// …
"overrides": [
{
"files": "*.css",
"options": {
"tailwindPreserveWhitespace": false
}
}
]
}
I'll update the readme to clarify that this plugin also sorts things in @apply
.
What version of
prettier-plugin-tailwindcss
are you using?Trying to update to version
0.6.4
. but the issue is present on0.6.0
as well.What version of Tailwind CSS are you using?
3.4.4
What version of Node.js are you using?
20.10.0
What package manager are you using?
Yarn
What operating system are you using?
macOS
Reproduction URL
https://github.com/velin-deity/prettier-plugin-tailwind-reproduction
Describe your issue
prettier-plugin-tailwindcss
changes how Prettier formats.css
files. If I have a class declared likePrettier will raise a warning due to the wrapped lines. In our project repository, we noticed this when trying to upgrade from
0.5.14
to0.6.4
. In the reproduction repository, however, I see the issue even in older versions (e.g.0.5.12
).Expected behaviour: As described in the docs, the plugin should not affect CSS files.