Skip to content

Theme Customization

Harmonia gives you complete control over the look and feel of your interface through CSS variables. This makes it easy to create fully customized themes that reflect your brand’s identity, without breaking consistency or spending hours rewriting styles.

You can define these variables manually in your own CSS file or <style> block, or speed things up using Harmonia’s Theme Generator to design, preview, and export a theme in minutes.

CSS Theme Structure

Every Harmonia theme includes both light and dark variants.

  • Light theme values are applied under the :root and :host pseudo-class selectors.
  • Dark theme values are defined under the .dark CSS class selector.

This structure makes it simple to switch between themes dynamically and keep the design consistent.

Example

:root,
:host {
  --background: oklch(1 0 0);
  --foreground: oklch(0.3211 0 0);
  ...
}

.dark {
  --background: oklch(0.1776 0 0);
  --foreground: oklch(1 0 0);
  ...
}

CSS Variables

Harmonia ships with a default set of theme variables in the base CSS file. This means you don’t need to redefine every variable, just override the ones you care about.

For example, if you only want to change your primary brand color, your custom theme CSS can be as simple as:

:root,
:host {
  --primary: oklch(...);
  --primary-foreground: oklch(...);
  --primary-hover: oklch(...);
  --primary-active: oklch(...);
}

.dark {
  --primary: oklch(...);
  --primary-foreground: oklch(...);
  --primary-hover: oklch(...);
  --primary-active: oklch(...);
}

This approach keeps theming lightweight, flexible, and easy to maintain.

Colors

PropertyDescription
--backgroundBase background color for the application.
--foregroundBase foreground (text and icon) color.
--cardBackground color used for card components (card, alert).
--card-foregroundForeground color used within card components.
--popoverBackground color for popovers and floating surfaces.
--popover-foregroundForeground color for content displayed in popovers.
--primaryPrimary brand color. Used for key actions, active states, selections, and focus indicators.
--primary-foregroundForeground color displayed on primary surfaces.
--primary-hoverColor applied to primary elements on hover.
--primary-activeColor applied to primary elements when active or selected.
--secondarySecondary color used for less prominent actions or elements.
--secondary-foregroundForeground color displayed on secondary surfaces.
--secondary-hoverColor applied to secondary elements on hover.
--secondary-activeColor applied to secondary elements when active or selected.
--mutedSubdued color used for disabled states, placeholders, icons, and low-emphasis UI elements.
--muted-foregroundForeground color used on muted surfaces.
--split-handleDefault color for split view gutter handle.
--borderDefault color for borders and dividers.
--input-borderBorder color for all input components, including text fields, selects, and date pickers.
--input-backgroundBackground color for input components.
--ringColor used for focus outlines and accessibility indicators.
--negativeColor representing destructive or error states.
--negative-foregroundForeground color displayed on negative surfaces.
--negative-hoverHover state color for negative actions.
--negative-activeActive or selected state color for negative actions.
--positiveColor representing success or affirmative states.
--positive-foregroundForeground color displayed on positive surfaces.
--positive-hoverHover state color for positive actions.
--positive-activeActive or selected state color for positive actions.
--warningColor representing warning or cautionary states.
--warning-foregroundForeground color displayed on warning surfaces.
--warning-hoverHover state color for warning actions.
--warning-activeActive or selected state color for warning actions.
--informationColor representing informational or neutral states.
--information-foregroundForeground color displayed on informational surfaces.
--information-hoverHover state color for informational elements.
--information-activeActive or selected state color for informational elements.
--sidebarBackground color for the sidebar component.
--sidebar-foregroundDefault foreground color within the sidebar.
--sidebar-primaryPrimary color used for selected or emphasized sidebar items.
--sidebar-primary-foregroundForeground color for primary sidebar elements.
--sidebar-secondarySecondary color used for sidebar elements.
--sidebar-secondary-foregroundForeground color for secondary sidebar elements.
--sidebar-borderBorder color used within the sidebar.
--object-headerBackground color for object headers, toolbars, and tab bars.
--object-header-foregroundForeground color used within object headers.
--table-headerBackground color for table headers.
--table-header-foregroundForeground color for table header content.
--table-hoverBackground color applied to table cells, rows, or columns on hover.
--table-hover-foregroundForeground color applied to hovered table elements.
--table-activeBackground color applied to active or selected table elements.
--table-active-foregroundForeground color applied to active or selected table elements.

Fonts

PropertyDescription
--font-sansOrdered list of sans-serif font families, listed by priority.
--font-serifOrdered list of serif font families, listed by priority.
--font-monoOrdered list of monospace font families, listed by priority.
--tracking-normalDefault letter-spacing value used across the application.

Shadows

PropertyDescription
--shadow-xsExtra-small shadow for subtle elevation (e.g., 0 1px rgb(0 0 0 / 0.05)).
--shadow-smSmall shadow for low-elevation surfaces.
--shadow-mdMedium shadow for standard elevated surfaces.
--shadow-lgLarge shadow for high-elevation surfaces.
--shadow-xlExtra-large shadow for prominent elevated elements.
--shadow-buttonShadow applied to button components.
--shadow-inputShadow applied to input components, such as text fields and selects.

Radius & Spacing

PropertyDescription
--radius-controlBorder radius applied to all interactive control components, such as buttons, inputs, popovers, calendars, and listboxes.
--radiusBase radius value used to derive small, medium, large, and extra-large border radius variants.
--spacingBase spacing unit used to calculate paddings and margins throughout the interface.