Skip to content

Commit f94f33b

Browse files
committed
Update documentation
1 parent ee9ea05 commit f94f33b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,28 @@ function MyButton({ children }) {
9191
}
9292
```
9393

94+
#### Matching attributes with a prefix or suffix
95+
96+
```json5
97+
// .prettierrc
98+
{
99+
"tailwindAttributesStartsWith": ["data"],
100+
"tailwindAttributesEndsWith": ["ClassName"]
101+
}
102+
```
103+
104+
With this configuration, attributes like `data-active-classes` and `buttonClassName` will be sorted:
105+
106+
```jsx
107+
function MyButton({ children }) {
108+
return (
109+
<button buttonClassName="bg-blue-600 text-white">
110+
{children}
111+
</button>
112+
);
113+
}
114+
```
115+
94116
## Sorting classes in function calls
95117

96118
In addition to sorting classes in attributes, you can also sort classes in strings provided to function calls. This is useful when working with libraries like [clsx](https://github.com/lukeed/clsx) or [cva](https://cva.style/).

0 commit comments

Comments
 (0)