Skip to content

Commit 5fca754

Browse files
committed
add arbitrary variants to docs
1 parent 90cdd69 commit 5fca754

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ twMerge('[padding:1rem] p-8') // → '[padding:1rem] p-8'
114114

115115
Watch out for mixing arbitrary properties which could be expressed as Tailwind classes. tailwind-merge does not resolve conflicts between arbitrary properties and their matching Tailwind classes to keep the bundle size small.
116116

117+
### Supports arbitrary variants
118+
119+
```ts
120+
twMerge('[&:nth-child(3)]:py-0 [&:nth-child(3)]:py-4') // → '[&:nth-child(3)]:py-4'
121+
twMerge('dark:hover:[&:nth-child(3)]:py-0 hover:dark:[&:nth-child(3)]:py-4')
122+
// → 'hover:dark:[&:nth-child(3)]:py-4'
123+
```
124+
125+
Similarly to arbitrary properties, tailwind-merge does not resolve conflicts between arbitrary variants and their matching predefined modifiers, like `[&:focus]:ring` and `focus:ring`.
126+
117127
### Supports important modifier
118128

119129
```ts

0 commit comments

Comments
 (0)