Colors

Hummingbird provides a small set of semantic color variables, which makes it easy to apply and customize consistently across the project.

Overview

Instead of applying fixed Tailwind palette classes like:

  • text-red-500
  • bg-green-600
  • border-blue-700 etc.

It is recommended to rely on semantic color classes. Semantic colors are mapped to design tokens and automatically adapt when themes change.

For example,

  • text-primary
  • bg-subtle
  • border-light etc.

This approach prevents dependence on specific palette values (blue-500, green-600, etc.). Instead, components reference semantic roles (primary, secondary, warning), making the UI easier to maintain, brand, and theme.

Behind the scenes, each semantic color class points to a CSS variable. Updating or overriding that variable updates the color everywhere it’s used.

List of colors

Hummingbird provides a minimal but complete set of color roles:

Background colors
ClassCSS variable
bg-subtle--background-color-subtle
bg-muted--background-color-muted
bg-default--background-color-default
bg-highlight--background-color-highlight
bg-emphasis--background-color-emphasis
Text colors
Subtle texttext-subtle--text-color-subtle
Muted texttext-muted--text-color-muted
Default texttext-default--text-color-default
Highlight texttext-highlight--text-color-highlight
Emphasis texttext-emphasis--text-color-emphasis
Border colors
border-light--border-color-light
border-base--border-color-base
border-dark--border-color-dark
Actions colors (generate all color-related utilities)
Color nameDescription
Active color--color-active
Hover color--color-hover
Selected color--color-selected
Disabled textDisabled text color--color-disabled-color
Disabled Background--color-disabled
Focus color--color-focus
Theme colors (generate all color-related utilities)
Light color--color-light
Dark color--color-dark
Contrast
Contrast text color--color-contrast
Primary lighter color--color-primary-lighter
Primary light color--color-primary-light
Primary color--color-primary
Primary dark color--color-primary-dark
Primary darker color--color-primary-darker
Secondary lighter color--color-secondary-lighter
Secondary light color--color-secondary-light
Secondary color--color-secondary
Secondary dark color--color-secondary-dark
Secondary darker color--color-secondary-darker
Info lighter color--color-info-lighter
Info light color--color-info-light
Info color--color-info
Info dark color--color-info-dark
Info darker color--color-info-darker
Success lighter color--color-success-lighter
Success light color--color-success-light
Success color--color-success
Success dark color--color-success-dark
Success darker color--color-success-darker
Warning lighter color--color-warning-lighter
Warning light color--color-warning-light
Warning color--color-warning
Warning dark color--color-warning-dark
Warning darker color--color-warning-darker
Danger lighter color--color-danger-lighter
Danger light color--color-danger-light
Danger color--color-danger
Danger dark color--color-danger-dark
Danger darker color--color-danger-darker

How to use

Use semantic color classes like:

  • bg-primary
  • text-muted
  • border-base

These classes use theme’s color variables, so the UI stays consistent when customizing or switching themes.

<button class="bg-primary text-contrast hover:bg-primary-dark">
  Button
</button>

<p class="text-muted">Muted paragraph text</p>

<div class="border border-base bg-default p-4">
  Card with subtle border
</div>

Customize color

Override any color by redefining its CSS variable inside a @theme block after importing Hummingbird:

@import "tailwindcss";
@import "@hummingbirdui/hummingbird";

@theme {
--background-color-subtle: #eff2f8;
--color-primary: #0074e6;
--color-primary-dark: #001c38;
}