docs: update active link page to clarify twindv1 plugin usage (#2004)

This commit is contained in:
Reed von Redwitz
2023-11-06 14:08:53 +01:00
committed by GitHub
parent c172af67cf
commit 687d41d6d5
+19 -1
View File
@@ -29,7 +29,7 @@ a[data-ancestor] {
## Tailwind / Twind
In tailwind or tailwind like styling solutions you can style `data-*`-attributes
In tailwind or tailwind-like styling solutions you can style `data-*`-attributes
by prepending the classes with `[data-current]:`
```tsx
@@ -41,3 +41,21 @@ function Menu() {
);
}
```
### Twind Plugin
The original twind plugin (`import twindPlugin from "$fresh/plugins/twind.ts";`)
supports the above style:
```tsx
class="[data-current]:text-green-600"
```
### TwindV1 Plugin
The new twind plugin (`import twindPlugin from "$fresh/plugins/twindv1.ts";`)
requires a slightly different syntax (note the position of the left bracket):
```tsx
class="data-[current]:text-green-600"
```