Colors
Overview of the color system and semantic color tokens in Apsara.Apsara uses a semantic color system that provides meaningful, context-aware colors for your interface. Rather than using fixed color values, semantic tokens represent the intended purpose of a color—such as "primary text" or "danger background"—and automatically resolve to the appropriate value based on the active theme and style. This abstraction allows you to build consistent, themeable interfaces by focusing on what a color represents rather than what it looks like.
Foreground Colors
Foreground colors are used for text, icons, and other content elements.
--rs-color-foreground-base-primary--rs-color-foreground-base-secondary--rs-color-foreground-base-tertiary--rs-color-foreground-base-emphasis--rs-color-foreground-accent-primary--rs-color-foreground-accent-primary-hover--rs-color-foreground-accent-emphasis--rs-color-foreground-danger-primary--rs-color-foreground-danger-primary-hover--rs-color-foreground-danger-emphasis--rs-color-foreground-attention-primary--rs-color-foreground-attention-primary-hover--rs-color-foreground-attention-emphasis--rs-color-foreground-success-primary--rs-color-foreground-success-primary-hover--rs-color-foreground-success-emphasisBackground Colors
Background colors define surfaces and containers in your interface.
--rs-color-background-base-primary--rs-color-background-base-primary-hover--rs-color-background-base-secondary--rs-color-background-neutral-primary--rs-color-background-neutral-secondary--rs-color-background-neutral-secondary-hover--rs-color-background-neutral-tertiary--rs-color-background-neutral-tertiary-hover--rs-color-background-neutral-emphasis--rs-color-background-accent-primary--rs-color-background-accent-emphasis--rs-color-background-accent-emphasis-hover--rs-color-background-danger-primary--rs-color-background-danger-emphasis--rs-color-background-danger-emphasis-hover--rs-color-background-attention-primary--rs-color-background-attention-emphasis--rs-color-background-attention-emphasis-hover--rs-color-background-success-primary--rs-color-background-success-emphasis--rs-color-background-success-emphasis-hoverBorder Colors
Border colors define boundaries and separators.
--rs-color-border-base-primary--rs-color-border-base-secondary--rs-color-border-base-tertiary--rs-color-border-base-tertiary-hover--rs-color-border-base-focus--rs-color-border-base-emphasis--rs-color-border-accent-primary--rs-color-border-accent-emphasis--rs-color-border-accent-emphasis-hover--rs-color-border-danger-primary--rs-color-border-danger-emphasis--rs-color-border-danger-emphasis-hover--rs-color-border-attention-primary--rs-color-border-attention-emphasis--rs-color-border-attention-emphasis-hover--rs-color-border-success-primary--rs-color-border-success-emphasis--rs-color-border-success-emphasis-hoverOverlay Colors
Overlay colors are used for modals, tooltips, and layered elements.
--rs-color-overlay-base-primary--rs-color-overlay-black-a15%--rs-color-overlay-black-a210%--rs-color-overlay-black-a315%--rs-color-overlay-black-a420%--rs-color-overlay-black-a530%--rs-color-overlay-black-a640%--rs-color-overlay-black-a750%--rs-color-overlay-black-a860%--rs-color-overlay-black-a970%--rs-color-overlay-black-a1080%--rs-color-overlay-black-a1190%--rs-color-overlay-black-a1295%--rs-color-overlay-white-a15%--rs-color-overlay-white-a210%--rs-color-overlay-white-a315%--rs-color-overlay-white-a420%--rs-color-overlay-white-a530%--rs-color-overlay-white-a640%--rs-color-overlay-white-a750%--rs-color-overlay-white-a860%--rs-color-overlay-white-a970%--rs-color-overlay-white-a1080%--rs-color-overlay-white-a1190%--rs-color-overlay-white-a1295%Visualization Colors
A palette of colors designed for data visualization, charts, and graphs.
--rs-color-viz-sky-9--rs-color-viz-mint-9--rs-color-viz-lime-9--rs-color-viz-grass-9--rs-color-viz-green-9--rs-color-viz-jade-9--rs-color-viz-cyan-9--rs-color-viz-blue-9--rs-color-viz-iris-9--rs-color-viz-purple-9--rs-color-viz-pink-9--rs-color-viz-crimson-9--rs-color-viz-orange-9--rs-color-viz-gold-9Usage
1/* Custom status indicator */2.status-badge {3 padding: var(--rs-space-1) var(--rs-space-3);4 border-radius: var(--rs-radius-full);5}67.status-badge[data-status="active"] {8 background-color: var(--rs-color-background-success-primary);9 color: var(--rs-color-foreground-success-primary);10}1112.status-badge[data-status="pending"] {13 background-color: var(--rs-color-background-attention-primary);14 color: var(--rs-color-foreground-attention-primary);15}1617.status-badge[data-status="error"] {18 background-color: var(--rs-color-background-danger-primary);19 color: var(--rs-color-foreground-danger-primary);20}2122/* Data table with hover states */23.data-table-row {24 border-bottom: 1px solid var(--rs-color-border-base-primary);25}2627.data-table-row:hover {28 background-color: var(--rs-color-background-base-primary-hover);29}3031.data-table-cell-muted {32 color: var(--rs-color-foreground-base-tertiary);33}3435/* Metric card with visualization */36.metric-card {37 background: var(--rs-color-background-base-secondary);38 border: 1px solid var(--rs-color-border-base-primary);39}4041.metric-value {42 color: var(--rs-color-foreground-base-primary);43}4445.metric-trend-up {46 color: var(--rs-color-foreground-success-primary);47}4849.metric-trend-down {50 color: var(--rs-color-foreground-danger-primary);51}5253/* Sidebar navigation */54.nav-item {55 color: var(--rs-color-foreground-base-secondary);56}5758.nav-item:hover {59 background-color: var(--rs-color-background-neutral-secondary);60 color: var(--rs-color-foreground-base-primary);61}6263.nav-item[data-active="true"] {64 background-color: var(--rs-color-background-accent-primary);65 color: var(--rs-color-foreground-accent-primary);66}
Best Practices
- Use semantic tokens - Prefer semantic color tokens over raw color values for consistency and theming support
- Match foreground with background - Use corresponding foreground colors when placing text on semantic backgrounds (e.g.,
foreground-accent-emphasisonbackground-accent-emphasis) - Respect color hierarchy - Use primary colors for main content, secondary for supporting content, and tertiary for subtle elements
- Test in both themes - Ensure your color choices work well in both light and dark modes