Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan authored Apr 10, 2024
1 parent b4aa821 commit 360cb77
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ npm install -D prettier prettier-plugin-tailwindcss

Then add the plugin to your [Prettier configuration](https://prettier.io/docs/en/configuration.html):

```json
```json5
// .prettierrc
{
"plugins": ["prettier-plugin-tailwindcss"]
}
Expand All @@ -32,10 +33,10 @@ By default the plugin will look for this file in the same directory as your Pret

Note that paths are resolved relative to the Prettier configuration file.

```js
// prettier.config.js
module.exports = {
tailwindConfig: './styles/tailwind.config.js',
```json5
// .prettierrc
{
"tailwindConfig": "./styles/tailwind.config.js"
}
```

Expand All @@ -47,10 +48,10 @@ By default this plugin only sorts classes in the `class` attribute as well as an

You can sort additional attributes using the `tailwindAttributes` option, which takes an array of attribute names:

```js
// prettier.config.js
module.exports = {
tailwindAttributes: ['myClassList'],
```json5
// .prettierrc
{
"tailwindAttributes": ["myClassList"]
}
```

Expand All @@ -72,10 +73,10 @@ In addition to sorting classes in attributes, you can also sort classes in strin

You can sort classes in function calls using the `tailwindFunctions` option, which takes a list of function names:

```js
// prettier.config.js
module.exports = {
tailwindFunctions: ['clsx'],
```json5
// .prettierrc
{
"tailwindFunctions": ["clsx"]
}
```

Expand Down Expand Up @@ -106,10 +107,10 @@ This plugin also enables sorting of classes in tagged template literals.

You can sort classes in template literals using the `tailwindFunctions` option, which takes a list of function names:

```js
// prettier.config.js
module.exports = {
tailwindFunctions: ['tw'],
```json5
// .prettierrc
{
"tailwindFunctions": ["tw"],
}
```

Expand Down

0 comments on commit 360cb77

Please sign in to comment.