# Colors

Explore semantic color roles and primitive palettes for light and dark product surfaces.

Color starts with intent. Zenos components use semantic roles for surfaces, content, structure, and feedback, while primitive ramps provide the building blocks for a custom theme.

## Semantic roles

Use the role that describes the job a color performs, rather than the color it happens to render. Every swatch below uses the active theme value, so the same role adapts when you switch between light and dark mode.

The list focuses on the roles used most often in product interfaces. The public `@zentara-co/zenos-ui/colors.css` stylesheet also includes the complete accent ramps, interaction states, and chart permutations for specialist cases.

## Usage

Add package CSS imports to your global `index.css`: use `@zentara-co/zenos-ui/tailwind.css` after `tailwindcss` for Tailwind v4, `@zentara-co/zenos-ui/styles.css` without Tailwind, or `@zentara-co/zenos-ui/colors.css` when you only need the color tokens. Reference semantic variables in application styles:

```css
.product-card {
  background: var(--background-neutral-card);
  color: var(--text-default);
  border: 1px solid var(--border-default);
}

.product-card__description {
  color: var(--text-subtle);
}

.product-card__error {
  background: var(--background-danger-subtlest-default);
  color: var(--text-danger-default);
  border-color: var(--border-danger-subtle);
}
```

Tailwind consumers can use the corresponding semantic utilities, such as `bg-background-neutral-card`, `text-text-default`, and `border-border-default`. The `--color-*` aliases connect these utilities to the same mode-aware semantic variables.

Set `data-theme="light"` or `data-theme="dark"` on a theme container to choose a mode explicitly. The `.dark` class also enables dark mode; without an explicit mode, the stylesheet follows the system preference.

## Primitive palettes

Primitive ramps are mode-independent building blocks for themes, data visualizations, and application-specific color roles. Each ramp is available as a CSS variable and a Tailwind color utility. Hover or focus a swatch to inspect its token name. The palette scrolls horizontally on narrow screens.

## Zentara brand colors

<div className="zenos-token-grid not-content">
  <div
    className="zenos-token"
    style={{ background: "var(--color-zentara-red)", color: "var(--color-zentara-white)" }}
  >
    <strong>Zentara red</strong>
    <span>Primary brand · #d31510</span>
    <code>--color-zentara-red</code>
  </div>
  <div
    className="zenos-token"
    style={{ background: "var(--color-zentara-black)", color: "var(--color-zentara-white)" }}
  >
    <strong>Zentara black</strong>
    <span>Dark neutral · #0f0f0f</span>
    <code>--color-zentara-black</code>
  </div>
  <div
    className="zenos-token"
    style={{ background: "var(--color-zentara-white)", color: "var(--color-zentara-black)" }}
  >
    <strong>Zentara white</strong>
    <span>Light neutral · #f9f9f9</span>
    <code>--color-zentara-white</code>
  </div>
</div>

Primitive values stay the same between light and dark mode. Theme authors map them to semantic roles whose values can change by mode.

## Best practices

- Prefer semantic roles in components; reserve primitive ramps for theme definitions and application-specific color roles.
- Pair background, text, icon, and border tokens with matching intent and appropriate contrast. Strong fills may need a contrary foreground, including the dedicated warning-contrary roles.
- Use status colors only for their meaning, not as arbitrary decoration.
- Check contrast on the actual rendered surface in both modes, especially for alpha colors and low-emphasis text.
- Preserve focus indicators and communicate state with labels, icons, or patterns as well as color.
- Override semantic variables in a scoped theme rather than hardcoding light-mode colors in component styles.

Source: https://zenos-ui.pages.dev/foundations/colors/