From 687d41d6d593bebb136944c8c3a080fdc6bccf80 Mon Sep 17 00:00:00 2001 From: Reed von Redwitz Date: Mon, 6 Nov 2023 14:08:53 +0100 Subject: [PATCH] docs: update active link page to clarify twindv1 plugin usage (#2004) --- docs/latest/examples/active-links.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/latest/examples/active-links.md b/docs/latest/examples/active-links.md index f05c8f91..af636240 100644 --- a/docs/latest/examples/active-links.md +++ b/docs/latest/examples/active-links.md @@ -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" +```