Skip to content

Commit d992637

Browse files
authored
(docs) update usage with tailwindcss plugin (#329)
1 parent e40ffbb commit d992637

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,19 @@ Whether or not to indent the code inside `<script>` and `<style>` tags in Svelte
151151

152152
## Usage with Tailwind Prettier Plugin
153153

154-
There's a Tailwind Prettier Plugin to format classes in a certain way. This plugin bundles `prettier-plugin-svelte`, so if you want to use the Tailwind plugin, uninstall `prettier-plugin-svelte` and use the Tailwind plugin instead. If you are using VS Code, make sure to have the Prettier extension installed and switch the default formatter for Svelte files to it.
154+
There is a [Tailwind Prettier Plugin](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) to format classes in a certain way. This plugin must be loaded last, so if you want to use the Tailwind plugin, disable Prettier auto-loading and place `prettier-plugin-tailwindcss` in the end of the plugins array. If you are using VS Code, make sure to have the Prettier extension installed and switch the default formatter for Svelte files to it.
155+
156+
```json5
157+
// .prettierrc
158+
{
159+
// ..
160+
"plugins": [
161+
"prettier-plugin-svelte",
162+
"prettier-plugin-tailwindcss" // MUST come last
163+
],
164+
"pluginSearchDirs": false
165+
}
166+
```
155167

156168
More info: https://github.com/tailwindlabs/prettier-plugin-tailwindcss#compatibility-with-other-prettier-plugins
157169

0 commit comments

Comments
 (0)