Table of contents
- Extending Tailwind and custom variables
- API reference
Note - This plugin works only with Tailwind CSS v1.2-canary. You can install
tailwindcss@canarywith NPM. There is an unmaintained version of this plugin available for Tailwind CSS v1.1. Check out the
tailwindcss-theming is a Tailwind plugin made to solve the common need to have multiple themes in an application.
It uses CSS custom properties in order to make your themes changeable on the client-side. Swapping themes is as simple as changing the class of your
Moreover, this plugin fully supports the
prefers-color-scheme media query, so you can setup a theme that will be automatically picked based on browser preferences.
$ yarn add tailwindcss-theming --dev
You won't be able to change theme at runtime, but at least your main and theme will work flawlessly.
A dark/light mode switch example - see here.