igniteui-angular-theming
Original:🇺🇸 English
Translated
Customize Ignite UI components styling using the igniteui-theming MCP server for AI-assisted theming
2installs
Added on
NPX Install
npx skill4agent add igniteui/igniteui-angular igniteui-angular-themingTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Ignite UI for Angular — Theming Skill
Description
This skill teaches AI agents how to theme Ignite UI for Angular applications using the Sass-based theming system and the Ignite UI Theming MCP server. It covers global themes, palettes, typography, elevations, component-level theming, layout controls (spacing, sizing, roundness), and how to use the MCP tools for code generation.
Prerequisites
- An Angular project with installed, or
igniteui-angularfor licensed users@infragistics/igniteui-angular - Sass support enabled in the project (default for Angular CLI projects)
- The Ignite UI Theming MCP server () available as a tool provider
igniteui-theming
AGENT INSTRUCTION — MCP Server Setup (REQUIRED)Before using any theming tools, you MUST verify the MCP server is available by calling. If the tool is not available or the call fails, you MUST automatically configure it by following the setup process steps described below.detect_platformAfter writing the file, inform the user that the MCP server has been configured and they may need to reload the editor for the tools to activate. Start the MCP server and wait for that MCP server to start before continuing the theming related work. Do NOT skip this step or ask the user to do it manually.
Setting Up the Theming MCP Server
The Ignite UI Theming MCP server enables AI assistants to generate production-ready theming code. It must be configured in your editor before the theming tools become available.
VS Code
Create or edit in your project:
.vscode/mcp.jsonjson
{
"servers": {
"igniteui-theming": {
"command": "npx",
"args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
}
}
}This works whether is installed locally in or needs to be pulled from the npm registry — handles both cases.
igniteui-themingnode_modulesnpx -yCursor
Create or edit :
.cursor/mcp.jsonjson
{
"mcpServers": {
"igniteui-theming": {
"command": "npx",
"args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
}
}
}Claude Desktop
Edit the Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
json
{
"mcpServers": {
"igniteui-theming": {
"command": "npx",
"args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
}
}
}WebStorm / JetBrains IDEs
- Go to Settings → Tools → AI Assistant → MCP Servers
- Click + Add MCP Server
- Set Command to and Arguments to
npxigniteui-theming igniteui-theming-mcp - Click OK and restart the AI Assistant
Verifying the Setup
After configuring the MCP server, ask your AI assistant:
"Detect which Ignite UI platform my project uses"
If the MCP server is running, the tool will analyze your and return the detected platform (e.g., ).
detect_platformpackage.jsonangularTheming Architecture
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 |
Design Systems
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-schemaPre-built Themes
The quickest way to theme an app is to include a pre-built CSS file in :
angular.jsonjson
"styles": ["node_modules/igniteui-angular/styles/igniteui-angular.css"]Licensed package users: replacewithigniteui-angularin the path:@infragistics/igniteui-angularjson"styles": ["node_modules/@infragistics/igniteui-angular/styles/igniteui-angular.css"]
Available pre-built CSS files:
| File | Theme |
|---|---|
| Material Light |
| Material Dark |
| Fluent Light |
| Fluent Dark |
| Bootstrap Light |
| Bootstrap Dark |
| Indigo Light |
| Indigo Dark |
All files are located under (or for the licensed package).
node_modules/igniteui-angular/styles/node_modules/@infragistics/igniteui-angular/styles/Custom Sass Theme (Manual)
AGENT INSTRUCTION — Sass Theming Docs: If the user explicitly asks to build a Sass-based theme or configure Sass, refer to the dedicated Sass documentation:
Create a file and include it in :
styles.scssangular.jsonscss
// Open-source package
@use 'igniteui-angular/theming' as *;
// Licensed package — same Sass API, different import path
// @use '@infragistics/igniteui-angular/theming' as *;
$my-palette: palette(
$primary: #1976D2,
$secondary: #FF9800,
$surface: #FAFAFA
);
// 2. Typography (optional)
@include typography(
$font-family: $material-typeface,
$type-scale: $material-type-scale
);
// 3. Core reset & base styles
@include core();
// 4. Apply theme
@include theme(
$palette: $my-palette,
$schema: $light-material-schema
);For dark themes, use a dark surface color and a dark schema:
scss
$dark-palette: palette(
$primary: #90CAF9,
$secondary: #FFB74D,
$surface: #121212
);
@include theme(
$palette: $dark-palette,
$schema: $dark-material-schema
);Component-Level Theming
Docs: Component Themes
Override individual component appearance using component theme functions and the mixin.
tokensAGENT INSTRUCTION — No Hardcoded Colors (CRITICAL)Once a palette has been generated (viain Sass orpalette()/create_palettevia MCP), every color reference MUST come from the generated palette tokens — never hardcode hex/RGB/HSL values.create_themeUse,var(--ig-primary-500),var(--ig-secondary-300), etc. in CSS, or thevar(--ig-surface-500)MCP tool to obtain the correct token reference.get_colorWRONG (hardcoded hex — breaks theme switching, ignores the palette):scss$custom-avatar: avatar-theme( $background: #E91E63, $color: #FFFFFF );RIGHT (palette token — stays in sync with the theme):scss$custom-avatar: avatar-theme( $schema: $light-material-schema, $background: var(--ig-primary-500), $color: var(--ig-primary-500-contrast) );This applies to all style code: component themes, custom CSS rules, Sass variables used for borders/backgrounds/text, Angularbindings, and inline styles. The only place raw hex values belong is the initialhostcall that seeds the color system. Everything downstream must reference the palette.palette()
scss
@use 'igniteui-angular/theming' as *;
$custom-avatar: avatar-theme(
$schema: $light-material-schema,
$background: var(--ig-primary-500),
$color: var(--ig-primary-500-contrast)
);
igx-avatar {
@include tokens($custom-avatar);
}Discovering Available Tokens
Each component has its own set of design tokens (themeable CSS custom properties). Before theming a component, you must know which tokens exist. Use the MCP tool to discover them.
get_component_design_tokensCompound Components
Some components (e.g., , , , ) are compound — they contain internal child components, each requiring their own theme. For example, uses , , and internally.
combogriddate-pickerselectdate-pickercalendarflat-buttoninput-groupWorkflow for compound components:
- Call for the parent (e.g.,
get_component_design_tokens)date-picker - The response lists related themes and scope selectors
- Call for each child, using the parent's selector as the wrapper
create_component_theme
Layout Controls
Sizing
Docs: Display Density / Sizing
Controls the size of components via (values: 1 = small, 2 = medium, 3 = large):
--ig-sizecss
/* Global */
:root { --ig-size: 2; }
/* Component-scoped */
igx-grid { --ig-size: 1; }Spacing
Docs: Spacing
Controls internal padding via (1 = default, 0.5 = compact, 2 = spacious):
--ig-spacingcss
:root { --ig-spacing: 1; }
.compact-section { --ig-spacing: 0.75; }Roundness
Controls border-radius via (0 = square, 1 = maximum radius):
--ig-radius-factorcss
:root { --ig-radius-factor: 1; }
igx-avatar { --ig-radius-factor: 0.5; }Using the Theming MCP Server
The Ignite UI Theming MCP server provides tools for AI-assisted theme code generation.
IMPORTANT — File Safety Rule: When generating or updating theme code, never overwrite existing style files directly. Instead, always propose the changes as an update and let the user review and approve before writing to disk. If a(or any target file) already exists, show the generated code as a diff or suggestion rather than replacing the file contents. This prevents accidental loss of custom styles the user has already written.styles.scss
Always follow this workflow:
Step 1 — Detect Platform
Tool: detect_platformThis auto-detects from and sets the correct import paths.
angularpackage.jsonStep 2 — Generate a Full Theme
Tool: create_theme
Params: {
platform: "angular",
designSystem: "material",
primaryColor: "#1976D2",
secondaryColor: "#FF9800",
surfaceColor: "#FAFAFA",
variant: "light",
fontFamily: "'Roboto', sans-serif",
includeTypography: true,
includeElevations: true
}Generates a complete Sass file with palette, typography, elevations, and the mixin call.
theme()Step 3 — Customize Individual Components
Tool: get_component_design_tokens
Params: { component: "grid" }Then use palette token references (not hardcoded hex values) for every color:
Tool: create_component_theme
Params: {
platform: "angular",
designSystem: "material",
variant: "light",
component: "grid",
tokens: {
"header-background": "var(--ig-primary-50)",
"header-text-color": "var(--ig-primary-800)"
}
}Reminder: After a palette is generated, all token values passed tomust reference palette CSS custom properties (e.g.,create_component_theme,var(--ig-primary-500),var(--ig-secondary-A200)). Never pass raw hex values likevar(--ig-gray-100)."#E3F2FD"
Step 4 — Generate a Palette
For simple mid-luminance base colors:
Tool: create_palette
Params: {
platform: "angular",
primary: "#1976D2",
secondary: "#FF9800",
surface: "#FAFAFA",
variant: "light"
}For brand-specific exact shade values, use with for full control over each shade.
create_custom_palettemode: "explicit"Step 5 — Adjust Layout
Tool: set_size → { size: "medium" }
Tool: set_spacing → { spacing: 0.75, component: "grid" }
Tool: set_roundness → { radiusFactor: 0.8 }Step 6 — Reference Palette Colors (MANDATORY for All Color Usage)
After a palette is generated, always use the tool to obtain the correct CSS custom property reference. Never hardcode hex/RGB/HSL values in component themes, custom CSS, or Sass variables.
get_colorTool: get_color
Params: { color: "primary", variant: "600" }
→ var(--ig-primary-600)
Params: { color: "primary", variant: "600", contrast: true }
→ var(--ig-primary-600-contrast)
Params: { color: "primary", opacity: 0.5 }
→ hsl(from var(--ig-primary-500) h s l / 0.5)Use these token references everywhere:
- Component theme values
tokens - Custom CSS rules (,
color,background,border-color,fill, etc.)stroke - Sass variables for derived values ()
$sidebar-bg: var(--ig-surface-500); - Angular style bindings
host
The only place raw hex values are acceptable is in the initial call or the / MCP tool inputs that seed the color system.
palette()create_palettecreate_themeLoading Reference Data
Use with these URIs for preset values and documentation:
read_resource| URI | Content |
|---|---|
| Preset palette colors |
| Typography presets |
| Elevation shadow presets |
| Which shades for which purpose |
| Semantic color roles |
| Light/dark theme rules |
| Angular platform specifics |
Referencing Colors in Custom Styles
After a theme is applied, the palette is available as CSS custom properties on . Use these tokens in all custom CSS — never introduce standalone hex/RGB variables for colors that the palette already provides.
:rootCorrect: Palette Tokens
scss
// All colors come from the theme — respects palette changes and dark/light switching
.sidebar {
background: var(--ig-surface-500);
color: var(--ig-gray-900);
border-right: 1px solid var(--ig-gray-200);
}
.accent-badge {
background: var(--ig-secondary-500);
color: var(--ig-secondary-500-contrast);
}
.hero-section {
// Semi-transparent primary overlay
background: hsl(from var(--ig-primary-500) h s l / 0.12);
}Incorrect: Hardcoded Values
scss
// WRONG — these break when the palette changes and ignore dark/light mode
$primary-color: #00838F; // ✗ hardcoded
$secondary-color: #3D5AFE; // ✗ hardcoded
$surface-color: #F0F5FA; // ✗ hardcoded
.sidebar {
background: $surface-color; // ✗ not a palette token
color: #333; // ✗ not a palette token
}When Raw Hex Values Are OK
Raw hex values are acceptable only in these contexts:
- call — the initial seed colors that generate the full palette
palette() - /
create_paletteMCP tool inputs — the base colors passed to the toolcreate_theme - Non-palette decorative values — e.g., a one-off SVG illustration color that intentionally stays fixed regardless of theme
Everything else must use tokens.
var(--ig-<family>-<shade>)Common Patterns
Switching Between Light and Dark Themes
scss
@use 'igniteui-angular/theming' as *;
$light-palette: palette($primary: #1976D2, $secondary: #FF9800, $surface: #FAFAFA);
$dark-palette: palette($primary: #90CAF9, $secondary: #FFB74D, $surface: #121212);
@include core();
@include typography($font-family: $material-typeface, $type-scale: $material-type-scale);
// Light is default
@include theme($palette: $light-palette, $schema: $light-material-schema);
// Dark via class on <body> or <html>
.dark-theme {
@include theme($palette: $dark-palette, $schema: $dark-material-schema);
}Scoping a Theme to a Container
scss
.admin-panel {
@include theme($palette: $admin-palette, $schema: $light-indigo-schema);
}Licensed Package Users
If using the licensed package, set on MCP tool calls and change the Sass import:
@infragistics/igniteui-angularlicensed: truescss
@use '@infragistics/igniteui-angular/theming' as *;Key Rules
- Never overwrite existing files directly — always propose theme code as an update for user review; do not replace existing style files without confirmation
- Always call first when using MCP tools
detect_platform - Always call before
get_component_design_tokensto discover valid token namescreate_component_theme - Palette shades 50 = lightest, 900 = darkest for all chromatic colors — never invert for dark themes (only gray inverts)
- Surface color must match the variant — light color for , dark color for
lightdark - Use once before
@include core()in your global styles@include theme() - Component themes use inside a selector to emit CSS custom properties
@include tokens($theme) - For compound components, follow the full checklist returned by — theme each child component with its scoped selector
get_component_design_tokens - Never hardcode colors after palette generation — once a palette is created, every color in component themes, custom CSS, and Sass variables must use palette tokens (e.g.,
var(--ig-<family>-<shade>),var(--ig-primary-500)). Raw hex/RGB/HSL values are only acceptable in the initialvar(--ig-gray-200)seed call. This ensures themes remain consistent, switchable (light/dark), and maintainablepalette()