You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,11 @@ This plugin follows the Prettier autoloading convention, so once it's installed
16
16
17
17
## Resolving your Tailwind configuration
18
18
19
-
By default this plugin will look for a [Tailwind configuration file](https://tailwindcss.com/docs/configuration) (`tailwind.config.js`) in the same directory as your Prettier configuration file.
19
+
To ensure that the class sorting is taking into consideration any of your project's Tailwind customizations, it needs access to your [Tailwind configuration file](https://tailwindcss.com/docs/configuration) (`tailwind.config.js`).
20
20
21
-
If your Tailwind configuration file is somewhere else, you can specify this using the `tailwindConfig` option in your Prettier configuration. Note that paths are resolved relative to the Prettier configuration file.
21
+
By default the plugin will look for this file in the same directory as your Prettier configuration file. However, if your Tailwind configuration is somewhere else, you can specify this using the `tailwindConfig` option in your Prettier configuration.
22
+
23
+
Note that paths are resolved relative to the Prettier configuration file.
22
24
23
25
```js
24
26
// prettier.config.js
@@ -27,10 +29,10 @@ module.exports = {
27
29
}
28
30
```
29
31
30
-
If a Tailwind configuration file cannot be found then the default Tailwind configuration will be used.
32
+
If a local configuration file cannot be found the plugin will fallback to the default Tailwind configuration.
31
33
32
34
## Compatibility with other Prettier plugins
33
35
34
-
To make this plugin work, we had to build it in a way that the Prettier plugin system was not designed for. We had to extend the core parsers in Prettier with our own custom parsers. And while this works, it makes this plugin incompatible with other Prettier plugins that are built the same way. This is a known limitation of Prettier.
36
+
To make this plugin work we had to build it in a way that the Prettier plugin system was not originally designed for. We had to extend the core parsers in Prettier with our own custom parsers. And while this totally works, it makes this plugin incompatible with other Prettier plugins that are built the same way.
35
37
36
-
One example of this incompatibility is with the [prettier-plugin-svelte](https://github.com/sveltejs/prettier-plugin-svelte) plugin. It's not possible to use the Svelte plugin at the same time as the Tailwind CSS plugin. However, as a workaround, we bundled the Svelte plugin into this plugin. Simply remove `prettier-plugin-svelte` from your Svelte project when installing the `prettier-plugin-tailwindcss` plugin, and everything should work fine.
38
+
One example of this incompatibility is with the [prettier-plugin-svelte](https://github.com/sveltejs/prettier-plugin-svelte) plugin. It's not possible to use the Svelte plugin at the same time as the Tailwind CSS plugin. However, as a workaround for this specific situation, we've bundled the Svelte plugin into our plugin. Simply remove `prettier-plugin-svelte` from your Svelte project when installing the `prettier-plugin-tailwindcss` plugin, and everything should continue working.
0 commit comments