Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,20 @@ Now set the `attribute` for your ThemeProvider to `data-mode`:
</ThemeProvider>
```

Add `@variant` selectors to your global css, e.g. TanStack's default `styles.css`:

```css
/* This configures the 'dark:' prefix for Tailwind */
@variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));
```

You can use `@variant` to create any number of custom themes:

```css
/* Custom 'jungle:' theme Tailwind selector */
@variant jungle (&:where([data-theme="jungle"], [data-theme="jungle"] *));
```

With this setup, you can now use Tailwind's dark mode classes, as in the previous example.

## Discussion
Expand Down