Loading...
Loading...
Customize Ignite UI components styling using the igniteui-theming MCP server for AI-assisted theming
npx skill4agent add igniteui/igniteui-angular igniteui-angular-themingigniteui-angular@infragistics/igniteui-angularigniteui-themingAGENT 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.
.vscode/mcp.json{
"servers": {
"igniteui-theming": {
"command": "npx",
"args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
}
}
}igniteui-themingnode_modulesnpx -y.cursor/mcp.json{
"mcpServers": {
"igniteui-theming": {
"command": "npx",
"args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
}
}
}~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json{
"mcpServers": {
"igniteui-theming": {
"command": "npx",
"args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
}
}
}npxigniteui-theming igniteui-theming-mcp"Detect which Ignite UI platform my project uses"
detect_platformpackage.jsonangular| 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 |
$light-material-schema$dark-fluent-schemaangular.json"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"]
| File | Theme |
|---|---|
| Material Light |
| Material Dark |
| Fluent Light |
| Fluent Dark |
| Bootstrap Light |
| Bootstrap Dark |
| Indigo Light |
| Indigo Dark |
node_modules/igniteui-angular/styles/node_modules/@infragistics/igniteui-angular/styles/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:
styles.scssangular.json// 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
);$dark-palette: palette(
$primary: #90CAF9,
$secondary: #FFB74D,
$surface: #121212
);
@include theme(
$palette: $dark-palette,
$schema: $dark-material-schema
);Docs: Component Themes
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()
@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);
}get_component_design_tokenscombogriddate-pickerselectdate-pickercalendarflat-buttoninput-groupget_component_design_tokensdate-pickercreate_component_themeDocs: Display Density / Sizing
--ig-size/* Global */
:root { --ig-size: 2; }
/* Component-scoped */
igx-grid { --ig-size: 1; }Docs: Spacing
--ig-spacing:root { --ig-spacing: 1; }
.compact-section { --ig-spacing: 0.75; }--ig-radius-factor:root { --ig-radius-factor: 1; }
igx-avatar { --ig-radius-factor: 0.5; }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
Tool: detect_platformangularpackage.jsonTool: create_theme
Params: {
platform: "angular",
designSystem: "material",
primaryColor: "#1976D2",
secondaryColor: "#FF9800",
surfaceColor: "#FAFAFA",
variant: "light",
fontFamily: "'Roboto', sans-serif",
includeTypography: true,
includeElevations: true
}theme()Tool: get_component_design_tokens
Params: { component: "grid" }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"
Tool: create_palette
Params: {
platform: "angular",
primary: "#1976D2",
secondary: "#FF9800",
surface: "#FAFAFA",
variant: "light"
}create_custom_palettemode: "explicit"Tool: set_size → { size: "medium" }
Tool: set_spacing → { spacing: 0.75, component: "grid" }
Tool: set_roundness → { radiusFactor: 0.8 }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)tokenscolorbackgroundborder-colorfillstroke$sidebar-bg: var(--ig-surface-500);hostpalette()create_palettecreate_themeread_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 |
:root// 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);
}// 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
}palette()create_palettecreate_themevar(--ig-<family>-<shade>)@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);
}.admin-panel {
@include theme($palette: $admin-palette, $schema: $light-indigo-schema);
}@infragistics/igniteui-angularlicensed: true@use '@infragistics/igniteui-angular/theming' as *;detect_platformget_component_design_tokenscreate_component_themelightdark@include core()@include theme()@include tokens($theme)get_component_design_tokensvar(--ig-<family>-<shade>)var(--ig-primary-500)var(--ig-gray-200)palette()