Global Theme Variables

This page lists the global CSS variables exposed through globals.scss and used throughout Boreal UI.
Variables are grouped into smaller tables so they are easier to browse and search by category.

Colors

Brand, semantic, and supporting color tokens.

Sortable data table
VariableUsage
--error-colorColor for error messages or failure states
--error-color-hoverHover color for error-based UI states
--primary-colorMain brand color for primary buttons, highlights, and accents
--primary-color-hoverDarker variant of the primary color for hover states
--primary-color-lightLighter variant of the primary color for subtle accents
--quaternary-colorOptional quaternary color used for additional accents
--quaternary-color-hoverDarker variant of the quaternary color
--quaternary-color-lightLighter variant of the quaternary color
--secondary-colorSecondary brand color used for secondary buttons and accents
--secondary-color-hoverDarker variant of the secondary color
--secondary-color-lightLighter variant of the secondary color
--success-colorColor for success messages or positive states
--success-color-hoverHover color for success-based UI states
--tertiary-colorOptional tertiary color used for supporting UI elements
--tertiary-color-hoverDarker variant of the tertiary color
--tertiary-color-lightLighter variant of the tertiary color
--text-color-primaryText color that contrasts well on primary surfaces
--text-color-primary-contrastContrast text token paired with the primary surface
--text-color-quaternaryText color that contrasts well on quaternary surfaces
--text-color-secondaryText color that contrasts well on secondary surfaces
--text-color-tertiaryText color that contrasts well on tertiary surfaces
--warning-colorColor for warnings or caution states
--warning-color-hoverHover color for warning-based UI states

Backgrounds

Background and surface-related tokens.

Sortable data table
VariableUsage
--background-colorDefault background color for the page
--background-color-darkSlightly darker variant of the background color
--background-color-darkerEven darker variant of the background color
--background-color-lightSlightly lighter variant of the background color
--background-color-lighterEven lighter variant of the background color
--background-color-surfaceSurface background color for cards, panels, and modals

Text

Text and readability tokens.

Sortable data table
VariableUsage
--text-colorDefault text color for most UI elements
--text-color-lightMuted text color for secondary content
--text-color-lighterFaint text color for subtle or disabled content

Links

Link styling tokens.

Sortable data table
VariableUsage
--link-colorDefault color for links
--link-hover-colorColor for links when hovered
--link-hover-color-primaryPrimary color for link hover states
--link-hover-color-secondarySecondary color for link hover states

Interaction

Focus, overlays, disabled states, and UI interaction tokens.

Sortable data table
VariableUsage
--disabled-colorColor for disabled elements
--divider-colorColor used for dividers and borders
--focus-outline-colorOutline color for focus states
--overlay-colorOverlay color for modals or dropdown backdrops

Spacing

Spacing scale used for padding, gaps, and margins.

Sortable data table
VariableUsage
--spacing-lgLarge spacing token
--spacing-mdMedium spacing token
--spacing-smSmall spacing token
--spacing-xlExtra large spacing token
--spacing-xsExtra small spacing token
--spacing-xxsExtra extra small spacing token

Typography

Font families, sizes, weights, line heights, and semantic text roles.

Sortable data table
VariableUsage
--font-family-bodyFont family used for body copy
--font-family-headingFont family used for headings
--font-family-monoMonospace font family for code text
--font-family-primaryPrimary font family token
--font-family-secondarySecondary font family token
--font-family-uiFont family used for controls and UI text
--font-size-baseDefault font size token
--font-size-bodySemantic font size for body text
--font-size-body-lgSemantic font size for large body text
--font-size-body-smSemantic font size for small body text
--font-size-captionSemantic font size for captions
--font-size-displayLargest semantic text size for display headings
--font-size-h1Semantic font size for h1 text
--font-size-h2Semantic font size for h2 text
--font-size-h3Semantic font size for h3 text
--font-size-h4Semantic font size for h4 text
--font-size-h5Semantic font size for h5 text
--font-size-h6Semantic font size for h6 text
--font-size-labelSemantic font size for labels
--font-size-lgLarge font size token
--font-size-mdMedium font size token
--font-size-overlineSemantic font size for overline text
--font-size-smSmall font size token
--font-size-xlExtra large font size token
--font-size-xsExtra small font size token
--font-size-xxlExtra extra large font size token
--font-size-xxsExtra extra small font size token
--font-weight-bodyDefault body text font weight
--font-weight-boldBold font weight token
--font-weight-bolderExtra bold font weight token
--font-weight-codeDefault code text font weight
--font-weight-headingDefault heading font weight
--font-weight-labelDefault label font weight
--font-weight-lightLight font weight token
--font-weight-mediumMedium font weight token
--font-weight-normalNormal font weight token
--letter-spacing-bodyLetter spacing for body text
--letter-spacing-captionLetter spacing for captions
--letter-spacing-codeLetter spacing for code text
--letter-spacing-displayLetter spacing for display text
--letter-spacing-headingLetter spacing for headings
--letter-spacing-labelLetter spacing for labels
--letter-spacing-overlineLetter spacing for overline text
--line-height-bodyLine height for body text
--line-height-captionLine height for caption text
--line-height-codeLine height for code text
--line-height-displayLine height for display text
--line-height-headingLine height for heading text
--line-height-labelLine height for label text

Border Radius

Rounding tokens used across components.

Sortable data table
VariableUsage
--border-radius-fullFull rounding for pill or circular shapes
--border-radius-lgLarge border radius token
--border-radius-mdMedium border radius token
--border-radius-noneNo rounding for UI elements
--border-radius-roundRound border radius token for circular elements
--border-radius-smSmall border radius token
--border-radius-xlExtra large border radius token
--border-radius-xsExtra small border radius token

Shadows

Standard elevation tokens.

Sortable data table
VariableUsage
--box-shadow-heavyStrong shadow for prominent elevation
--box-shadow-intenseIntense shadow for deep elevation
--box-shadow-lightLight shadow for subtle elevation
--box-shadow-mediumMedium shadow for moderate elevation
--box-shadow-noneNo shadow

Inverted Shadows

Inverted shadow tokens for dark or alternative surfaces.

Sortable data table
VariableUsage
--box-shadow-inverted-intenseIntense inverted shadow
--box-shadow-inverted-lightLight inverted shadow
--box-shadow-inverted-mediumMedium inverted shadow
--box-shadow-inverted-noneNo inverted shadow
--box-shadow-inverted-strongStrong inverted shadow

Transitions

Motion timing tokens.

Sortable data table
VariableUsage
--transition-defaultDefault transition duration
--transition-fastFast transition duration
--transition-slowSlow transition duration

Updating Non-Context Variables

Variables such as spacing, typography, border radius, and shadows are not managed by the ThemeProvider and should be updated directly in your global styles.

1. Import Boreal UI Styles

Import the library styles before your custom overrides:

// React (Core) entry file: src/index.tsx
import "boreal-ui/core/boreal-ui.css";

// Next.js entry file: app/layout.tsx
import "boreal-ui/next/boreal-ui.css";

2. Define Variables in globals.scss or globals.css

Add or override your tokens inside :root.

/* globals.scss or globals.css */
:root {
  --font-family-body: "Inter", Arial, sans-serif;
  --font-family-heading: "Lora", serif;

  --font-size-body: 18px;
  --font-size-h1: 40px;
  --font-size-label: 14px;

  --font-weight-body: 400;
  --font-weight-heading: 700;
  --font-weight-label: 600;

  --line-height-body: 1.6;
  --line-height-heading: 1.2;

  --letter-spacing-body: 0;
  --letter-spacing-overline: 0.08em;

  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 32px;

  --border-radius-sm: 4px;
  --border-radius-lg: 12px;

  --box-shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
  --box-shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.2);
}

3. Import Your Global Styles After Boreal UI

Import your own global stylesheet after Boreal UI so your custom variables override the defaults.

React (Core)

// src/index.tsx
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import "boreal-ui/core/boreal-ui.css";
import "./globals.scss";

ReactDOM.createRoot(document.getElementById("root")!).render(<App />);

Next.js

// app/layout.tsx
import "boreal-ui/next/boreal-ui.css";
import "./globals.css";

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  );
}