Palette
A guide to customizing the palette of your theme.
Tailus UI Html is built on top of Tailwind Css, which means that you can customize the colors of your theme by changing the colors in the tailwind.config.js
file.
Semantic Naming
Our color system uses semantic color names to make it intuitive to understand the purpose of each color. For instance, primary is used for primary actions, success for success notifications, danger for error alerts, and so on. This approach simplifies the process of customizing and maintaining your application’s color palette.
Required Colors
For the theme to function properly, certain colors are necessary. Each color should have shades ranging from 50
to 950
. However, the gray
color is an exception and must include an additional 925
shade.
Primary
Secondary
Accent
Success
Danger
Warning
Info
Gray
Default Palettes
Tailus UI HTML comes with nine pre-configured color palettes for a quick start. To use these default palettes, you need to import the palettes
object.
The available palettes are as follows:
trust
oz
mystery
romance
passion
energy
spring
nature
winter
Override default palettes
If you want to override a color in a palette, you can simply replace it with a new color. This new color can be from Tailwind’s default colors or your own custom colors.
For instance, in the oz
palette, indigo
is the primary color. If you wish to change this primary color to purple
, you can use the spread operator to merge the existing oz
palette with your new color. This way, all the original colors are preserved, and the primary color is replaced with purple
.
If you wish to replace a gray color with a default gray color from Tailwind CSS, we recommend using the grays
from @tailus/themer-plugins
. This is because it includes a 925 shade, providing a wider range of shades.
Using Css variables
Please read the Tailwind Css documentation to learn more about how to define your colors as css variables