Requires Sass configured in the project (e.g.,
sassindevDependenciesand Vite/webpack configured to handle.scssfiles).
// src/styles.scss
@use 'igniteui-theming' as *;
// 1. Define a palette
$my-palette: palette(
$primary: #1976D2,
$secondary: #FF9800,
$surface: #FAFAFA
);
// 2. Apply the palette
@include palette($my-palette);
// 3. Optional: Typography
@include typography($font-family: "'Roboto', sans-serif");
// 4. Optional: Elevations
@include elevations();
// 5. Optional: Spacing
@include spacing();Import in your React entry point:
// main.tsx
import './styles.scss';For dark themes, use a dark surface color and a dark schema:
@use 'igniteui-theming' as *;
$dark-palette: palette(
$primary: #90CAF9,
$secondary: #FFB74D,
$surface: #121212
);
@include palette($dark-palette, $schema: $dark-material-schema);Important: Use
@use 'igniteui-theming'— notigniteui-angular/themingor Angular-specificcore()/theme()mixins.
When Sass is configured, use component theme functions and the tokens mixin:
@use 'igniteui-theming' as *;
$custom-avatar: avatar-theme(
$schema: $light-material-schema,
$background: var(--ig-primary-500),
$color: var(--ig-primary-500-contrast)
);
igc-avatar {
@include tokens($custom-avatar);
}@use 'igniteui-theming' as *;
$light-palette: palette($primary: #1976D2, $secondary: #FF9800, $surface: #FAFAFA);
$dark-palette: palette($primary: #90CAF9, $secondary: #FFB74D, $surface: #121212);
@include typography($font-family: "'Roboto', sans-serif");
@include elevations();
// Light is default
@include palette($light-palette, $schema: $light-material-schema);
// Dark via class on a container or <body>
.dark-theme {
@include palette($dark-palette, $schema: $dark-material-schema);
}The Ignite UI theming system is built on four pillars:
| Concept | Purpose |
|---|---|
| Palette | Color system with primary, secondary, surface, gray, info, success, warn, error families, each with shades 50–900 + accents A100–A700 |
| Typography | Font family, type scale (h1–h6, subtitle, body, button, caption, overline) |
| Elevations | Box-shadow levels 0–24 for visual depth |
| Schema | Per-component recipes mapping palette colors to component tokens |
Four built-in design systems are available:
- Material (default) — Material Design 3
- Bootstrap — Bootstrap-inspired
- Fluent — Microsoft Fluent Design
- Indigo — Infragistics Indigo Design
Each has light and dark variants (e.g., $light-material-schema, $dark-fluent-schema).
- Shades 50 = lightest, 900 = darkest for all chromatic colors
- Surface color must match the variant — light color for
light, dark color fordark
- Sass: Use
@use 'igniteui-theming'— notigniteui-angular/theming - Sass: Component themes use
@include tokens($theme)inside a selector - Never hardcode colors after palette generation — use
var(--ig-<family>-<shade>)palette tokens everywhere