Getting Started π
Colorwind is a TailwindCSS plugin that simplifies the management of light and dark mode color schemes by dynamically adjusting colors for different utilities like text, background, borders, and more. With a single class, you can define colors that automatically adapt to both themes.
β¨ Features
- Effortless Color Management: Automatically switch between light and dark mode color schemes using simple utility classes.
- All TailwindCSS Colors Supported: Choose from all available colors in TailwindCSS for your elements.
- Gradient and Opacity Support: Apply background gradients and control opacity seamlessly.
- Utility Flexibility: Use with text, background, border, outline, shadow, fill, stroke, and more.
π Requirements
Requires tailwindcss@^3.4.3.
β‘οΈ Installation
You can install ColorWind
from NPM
or JSR
:
From NPM
:
From JSR
:
From NPM
:
From JSR
:
From NPM
:
From JSR
:
From NPM
:
From JSR
:
From NPM
:
From JSR
:
π§ Configuration
Add ColorWind
to your TailwindCSS configuration:
π Color System
Colorwind allows you to define colors using the following utility classes:
Utility | Description |
---|---|
text | color |
bg | background-color |
decoration | text-decoration-color |
border | border-color |
outline | outline-color |
accent | accent-color |
caret | caret-color |
divide | border-color |
fill | fill |
stroke | stroke |
shadow | --tw-shadow-color |
ring | --tw-ring-color |
You can specify light/dark color variations using a number system:
-
utility-color-X
, whereX
corresponds to the following:Value Light Mode Dark Mode 0
color-50
color-950
1
color-100
color-900
2
color-200
color-800
3
color-300
color-700
4
color-400
color-600
color
color-500
in both light and dark modes
Colorwind allows you to specify the utility and the color separately for more flexibility. For example:
text underline text-decoration red
will applyred-500
to both the text color and text decoration.- You can also specify individual utilities:
bg-blue
forblue-500
background color andborder-red
forred-500
border color.
This separation enables more flexibility when working with complex designs.
π§βπ» Usage
With Colorwind, you can easily define and apply color utilities that adjust automatically between light and dark modes. Hereβs how you can use different classes for color management:
1. Text with decoration color:
This text is red with a red underline.
2. Primary button with background and text colors:
3. Card with shadow and border:
Card with a blue background and slate border.