*Using hardcoded color names*
This is a hardcoded dark text on a light background,
it needs double the amount of class names to support dark mode.
```html
This is a hardcoded dark text on a light background,
it needs double the amount of class names to support dark mode.
```
- πͺ¦ Fixed color names, hardcoded based on the value
- π« No automatic dark mode
- π΅βπ« You have to add dark-mode colors for every element
- πΈ high maintenance cost
- π’ slow development
- π© hard to change a theme
- βοΈβπ₯ high chance of inconsistency
- π° You are limited to 2 themes only: light and dark
*Using semantic color names*
This is dark text on a light background,
which switches to light text on a dark background in dark mode.
```html
This is dark text on a light background,
which switches to light text on a dark background in dark mode.
```
- π― Semantic names, based on the purpose of the color
- β¨ Automatic dark mode
- π No need to add any dark-mode class names
- π€ Zero maintenance cost to add a theme
- π Fast development
- β‘οΈ Easy to change themes
- π All colors are consistent based on the design system
- βΎοΈ Unlimited themes, easy to switch
##
| | Color name | CSS variable | Where to use |
|--------------------------------------------------|-------------------|-----------------------------|--------------------------------------------------------------------|
| | primary | `--color-primary` | Primary brand color, The main color of your brand |
| | primary-content | `--color-primary-content` | Foreground content color to use on `primary` color
|
| | secondary | `--color-secondary` | Secondary brand color, The optional, secondary color of your brand |
| | secondary-content | `--color-secondary-content` | Foreground content color to use on `secondary` color
|
| | accent | `--color-accent` | Accent brand color, The optional, accent color of your brand |
| | accent-content | `--color-accent-content` | Foreground content color to use on `accent` color
|
| | neutral | `--color-neutral` | Neutral dark color, For not-saturated parts of UI |
| | neutral-content | `--color-neutral-content` | Foreground content color to use on neutral color
|
| | base-100 | `--color-base-100` | Base surface color of page, used for blank backgrounds |
| | base-200 | `--color-base-200` | Base color, darker shade, to create elevations |
| | base-300 | `--color-base-300` | Base color, even more darker shade, to create elevations |
| | base-content | `--color-base-content` | Foreground content color to use on `base` color
|
| | info | `--color-info` | Info color, For informative/helpful messages |
| | info-content | `--color-info-content` | Foreground content color to use on `info` color |
| | success | `--color-success` | Success color, For success/safe messages |
| | success-content | `--color-success-content` | Foreground content color to use on `success` color |
| | warning | `--color-warning` | Warning color, For warning/caution messages |
| | warning-content | `--color-warning-content` | Foreground content color to use on `warning` color |
| | error | `--color-error` | Error color, For error/danger/destructive messages |
| | error-content | `--color-error-content` | Foreground content color to use on `error` color |
##