Global Theme Variables
This table lists all explicitly defined CSS variables in globals.scss and their purpose.
Variables like colors are managed dynamically by the ThemeProvider, while design tokens such as spacing, border radius, and shadows remain static unless customized in globals.scss.
| Variable | Usage |
|---|---|
| --background-color | Default background color for the page |
| --background-color-dark | Slightly darker variant of the background color |
| --background-color-darker | Even darker variant of the background color |
| --background-color-light | Slightly lighter variant of the background color |
| --background-color-lighter | Even lighter variant of the background color |
| --border-radius-full | Full rounding for pill or circular shapes |
| --border-radius-lg | Large border radius for UI elements |
| --border-radius-md | Medium border radius for UI elements |
| --border-radius-none | No rounding for UI elements |
| --border-radius-sm | Small border radius for UI elements |
| --box-shadow-heavy | Strong shadow for prominent elevation |
| --box-shadow-intense | Intense shadow for deep elevation |
| --box-shadow-inverted-intense | Intense inverted shadow for dark themes |
| --box-shadow-inverted-light | Light inverted shadow for dark themes |
| --box-shadow-inverted-medium | Medium inverted shadow for dark themes |
| --box-shadow-inverted-none | No inverted shadow |
| --box-shadow-inverted-strong | Strong inverted shadow for dark themes |
| --box-shadow-light | Light shadow for subtle elevation |
| --box-shadow-medium | Medium shadow for moderate elevation |
| --box-shadow-none | No shadow |
| --disabled-color | Color for disabled elements |
| --divider-color | Color used for dividers and borders |
| --error-color | Color for error messages or failure states |
| --focus-outline-color | Outline color for focus states |
| --font-size-base | Default font size for most text |
| --font-size-heading | Font size for large headings |
| --link-color | Default color for links |
| --link-hover-color | Color for links when hovered |
| --link-hover-color-primary | Primary color for link hover states |
| --link-hover-color-secondary | Secondary color for link hover states |
| --overlay-color | Overlay color for modals or dropdown backdrops |
| --primary-color | Main brand color for primary buttons, highlights, and accents |
| --primary-color-hover | Darker variant of the primary color, used for hover states |
| --primary-color-light | Lighter variant of the primary color, used for hover states or subtle accents |
| --primary-text-color-contrast | Text color that contrasts well with the primary color |
| --quaternary-color | Optional quaternary color used for additional accents |
| --quaternary-color-hover | Darker variant of the quaternary color |
| --quaternary-color-light | Lighter variant of the quaternary color |
| --quaternary-text-color | Text color that contrasts well with the quaternary color |
| --secondary-color | Secondary brand color used for secondary buttons and accents |
| --secondary-color-hover | Darker variant of the secondary color |
| --secondary-color-light | Lighter variant of the secondary color |
| --secondary-text-color | Text color that contrasts well with the secondary color |
| --spacing-lg | Large spacing token for padding and margins |
| --spacing-md | Medium spacing token for padding and margins |
| --spacing-sm | Small spacing token for padding and margins |
| --success-color | Color for success messages or positive states |
| --tertiary-color | Optional tertiary color used for supporting UI elements |
| --tertiary-color-hover | Darker variant of the tertiary color |
| --tertiary-color-light | Lighter variant of the tertiary color |
| --tertiary-text-color | Text color that contrasts well with the tertiary color |
| --text-color | Default text color for most UI elements |
| --text-color-light | Muted text color for secondary content |
| --text-color-lighter | Faint text color for subtle or disabled content |
| --text-color-primary | Primary text color for high contrast content |
| --transition-default | Default transition duration for hover/focus states |
| --warning-color | Color for warnings or caution states |
Updating Non-Context Variables
Variables such as spacing, typography, border radius, and shadows are not managed by the ThemeProvider and must be updated directly in your global styles. These updates apply across both Boreal UI Core (React) and Boreal UI Next applications.
1. Import Boreal UI Styles
Import the library’s base styles before your custom overrides:
// React (Core) entry file: src/index.tsx import "boreal-ui/core/boreal-ui.css"; // Boreal UI Core styles // Next.js entry file: app/layout.tsx import "boreal-ui/next/boreal-ui.css"; // Boreal UI Next styles
2. Define Variables in globals.scss (React) or globals.css (Next.js)
Add or modify the variables inside :root in your global file:
// globals.scss (or globals.css)
:root {
--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);
--font-size-base: 16px;
--font-size-heading: 24px;
}3. Import Your Global Styles
Finally, import your global file after the Boreal UI styles so that 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/style.css"; // Boreal UI styles
import "./globals.scss"; // Your global overrides
ReactDOM.createRoot(document.getElementById("root")!).render(<App />);Next.js
// app/layout.tsx (Next.js 13+)
import "boreal-ui/next/style.css"; // Boreal UI styles
import "./globals.css"; // Your global overrides
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}Once imported, your custom variables will override Boreal UI defaults and apply across all components automatically.