igniteui-theming 27.3.0 → 27.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5426,6 +5426,16 @@
5426
5426
  "name": "item-border-radius",
5427
5427
  "type": "List",
5428
5428
  "description": "The border radius used for the navdrawer item."
5429
+ },
5430
+ {
5431
+ "name": "size",
5432
+ "type": "Number",
5433
+ "description": "The width of the navigation drawer in its expanded (full) state."
5434
+ },
5435
+ {
5436
+ "name": "size--mini",
5437
+ "type": "Number",
5438
+ "description": "The width of the navigation drawer in its mini state."
5429
5439
  }
5430
5440
  ]
5431
5441
  },
@@ -116,3 +116,80 @@ export interface ComponentThemeCssOptions {
116
116
  * // result.css contains: igc-button { --ig-button-background: var(--ig-button-background, #1976d2); ... }
117
117
  */
118
118
  export declare function generateComponentThemeCss(options: ComponentThemeCssOptions): Promise<CssComponentThemeResult>;
119
+ /**
120
+ * Options for generating typography CSS variables.
121
+ */
122
+ export interface TypographyCssOptions {
123
+ /** Font family string with fallbacks */
124
+ fontFamily?: string;
125
+ /** Design system preset (defaults to 'material') */
126
+ designSystem?: string;
127
+ /** Internal testing parameter for Sass importers */
128
+ _importers?: FileImporter[];
129
+ }
130
+ /**
131
+ * Generate CSS custom properties for a typography setup.
132
+ *
133
+ * Compiles the typography() mixin and returns the resulting CSS custom
134
+ * properties (--ig-h1-font-size, --ig-body-1-font-weight, etc.).
135
+ */
136
+ export declare function generateTypographyCss(options: TypographyCssOptions): Promise<CssPaletteResult>;
137
+ /**
138
+ * Options for generating elevations CSS variables.
139
+ */
140
+ export interface ElevationsCssOptions {
141
+ /** Design system preset: 'material' or 'indigo' (defaults to 'material') */
142
+ designSystem?: string;
143
+ /** Internal testing parameter for Sass importers */
144
+ _importers?: FileImporter[];
145
+ }
146
+ /**
147
+ * Generate CSS custom properties for elevations.
148
+ *
149
+ * Compiles the elevations() mixin and returns the resulting CSS custom
150
+ * properties (--ig-elevation-0 through --ig-elevation-24).
151
+ */
152
+ export declare function generateElevationsCss(options: ElevationsCssOptions): Promise<CssPaletteResult>;
153
+ /**
154
+ * Options for generating a complete theme's CSS variables.
155
+ */
156
+ export interface ThemeCssOptions {
157
+ platform?: (typeof PLATFORMS)[number];
158
+ designSystem?: string;
159
+ variant?: ThemeVariant;
160
+ primaryColor: string;
161
+ secondaryColor: string;
162
+ surfaceColor: string;
163
+ fontFamily?: string;
164
+ includeTypography?: boolean;
165
+ includeElevations?: boolean;
166
+ includeSpacing?: boolean;
167
+ name?: string;
168
+ /** Internal testing parameter for Sass importers */
169
+ _importers?: FileImporter[];
170
+ }
171
+ /**
172
+ * Result from generating a complete theme's CSS variables.
173
+ */
174
+ export interface CssThemeResult {
175
+ css: string;
176
+ description: string;
177
+ /**
178
+ * True when platform is 'angular'. Angular CSS output contains only
179
+ * CSS custom properties — it does not include the component-scoped class
180
+ * styles generated by Angular's core() and theme() mixins.
181
+ */
182
+ angularCaveat?: boolean;
183
+ }
184
+ /**
185
+ * Generate CSS custom properties for a complete theme.
186
+ *
187
+ * For Web Components, React, and Blazor this compiles the full
188
+ * palette + typography + elevations Sass and returns all resulting
189
+ * CSS custom properties in one block.
190
+ *
191
+ * For Angular the same approach is used, but the response carries
192
+ * `angularCaveat: true` to signal that component-scoped class styles
193
+ * (generated by core() + theme()) are absent from the CSS output.
194
+ */
195
+ export declare function generateThemeCss(options: ThemeCssOptions): Promise<CssThemeResult>;
@@ -158,5 +158,135 @@ ${selector} {
158
158
  throw new Error(`Failed to compile component theme CSS: ${message}`);
159
159
  }
160
160
  }
161
+ /**
162
+ * Generate CSS custom properties for a typography setup.
163
+ *
164
+ * Compiles the typography() mixin and returns the resulting CSS custom
165
+ * properties (--ig-h1-font-size, --ig-body-1-font-weight, etc.).
166
+ */
167
+ async function generateTypographyCss(options) {
168
+ const { TYPOGRAPHY_PRESETS } = await import("../knowledge/typography.js");
169
+ const { quoteFontFamily } = await import("../utils/sass.js");
170
+ const designSystem = options.designSystem ?? "material";
171
+ const preset = TYPOGRAPHY_PRESETS[designSystem];
172
+ const typeface = options.fontFamily || preset?.typeface || "Roboto, sans-serif";
173
+ const typeScaleVar = `$${designSystem}-type-scale`;
174
+ const sassCode = `
175
+ @use 'igniteui-theming/sass/typography' as *;
176
+ @use 'igniteui-theming/sass/typography/presets' as *;
177
+
178
+ @include typography(
179
+ $font-family: ${quoteFontFamily(typeface)},
180
+ $type-scale: ${typeScaleVar}
181
+ );
182
+ `;
183
+ try {
184
+ const importers = options._importers ?? [themingImporter];
185
+ return {
186
+ css: (await sass.compileStringAsync(sassCode, {
187
+ importers,
188
+ style: "expanded"
189
+ })).css,
190
+ description: `Generated CSS custom properties for typography using ${designSystem} type scale with font family ${typeface}`
191
+ };
192
+ } catch (error) {
193
+ const message = error instanceof Error ? error.message : String(error);
194
+ throw new Error(`Failed to compile typography CSS: ${message}`);
195
+ }
196
+ }
197
+ /**
198
+ * Generate CSS custom properties for elevations.
199
+ *
200
+ * Compiles the elevations() mixin and returns the resulting CSS custom
201
+ * properties (--ig-elevation-0 through --ig-elevation-24).
202
+ */
203
+ async function generateElevationsCss(options) {
204
+ const preset = options.designSystem ?? "material";
205
+ const sassCode = `
206
+ @use 'igniteui-theming/sass/elevations' as *;
207
+ @use 'igniteui-theming/sass/elevations/presets' as *;
208
+
209
+ @include elevations(${`$${preset}-elevations`});
210
+ `;
211
+ try {
212
+ const importers = options._importers ?? [themingImporter];
213
+ return {
214
+ css: (await sass.compileStringAsync(sassCode, {
215
+ importers,
216
+ style: "expanded"
217
+ })).css,
218
+ description: `Generated CSS custom properties for elevations using ${preset} preset (25 elevation levels)`
219
+ };
220
+ } catch (error) {
221
+ const message = error instanceof Error ? error.message : String(error);
222
+ throw new Error(`Failed to compile elevations CSS: ${message}`);
223
+ }
224
+ }
225
+ /**
226
+ * Generate CSS custom properties for a complete theme.
227
+ *
228
+ * For Web Components, React, and Blazor this compiles the full
229
+ * palette + typography + elevations Sass and returns all resulting
230
+ * CSS custom properties in one block.
231
+ *
232
+ * For Angular the same approach is used, but the response carries
233
+ * `angularCaveat: true` to signal that component-scoped class styles
234
+ * (generated by core() + theme()) are absent from the CSS output.
235
+ */
236
+ async function generateThemeCss(options) {
237
+ const { TYPOGRAPHY_PRESETS } = await import("../knowledge/typography.js");
238
+ const { quoteFontFamily, toVariableName } = await import("../utils/sass.js");
239
+ const designSystem = options.designSystem ?? "material";
240
+ const variant = options.variant ?? "light";
241
+ const isAngular = options.platform === "angular";
242
+ const paletteName = options.name ? `$${toVariableName(options.name)}-palette` : "$palette";
243
+ const includeTypography = options.includeTypography !== false;
244
+ const includeElevations = options.includeElevations !== false;
245
+ const includeSpacing = options.includeSpacing !== false;
246
+ const preset = TYPOGRAPHY_PRESETS[designSystem];
247
+ const typeface = options.fontFamily || preset?.typeface || "Roboto, sans-serif";
248
+ const typeScaleVar = `$${designSystem}-type-scale`;
249
+ const elevationsVar = designSystem === "indigo" ? "$indigo-elevations" : "$material-elevations";
250
+ const importLines = ["@use 'igniteui-theming/sass/color' as *;"];
251
+ if (includeTypography) {
252
+ importLines.push("@use 'igniteui-theming/sass/typography' as *;");
253
+ importLines.push("@use 'igniteui-theming/sass/typography/presets' as *;");
254
+ }
255
+ if (includeElevations) {
256
+ importLines.push("@use 'igniteui-theming/sass/elevations' as *;");
257
+ importLines.push("@use 'igniteui-theming/sass/elevations/presets' as *;");
258
+ }
259
+ if (includeSpacing) importLines.push("@use 'igniteui-theming/sass/themes' as *;");
260
+ const mixinLines = [];
261
+ mixinLines.push(`@include palette(${paletteName});`);
262
+ if (includeElevations) mixinLines.push(`@include elevations(${elevationsVar});`);
263
+ if (includeTypography) mixinLines.push(`@include typography(\n $font-family: ${quoteFontFamily(typeface)},\n $type-scale: ${typeScaleVar}\n);`);
264
+ if (includeSpacing) mixinLines.push("@include spacing();");
265
+ const sassCode = `
266
+ ${importLines.join("\n")}
267
+
268
+ ${paletteName}: palette(
269
+ $primary: ${options.primaryColor},
270
+ $secondary: ${options.secondaryColor},
271
+ $surface: ${options.surfaceColor}
272
+ );
273
+
274
+ ${mixinLines.join("\n")}
275
+ `;
276
+ try {
277
+ const importers = options._importers ?? [themingImporter];
278
+ return {
279
+ css: (await sass.compileStringAsync(sassCode, {
280
+ importers,
281
+ style: "expanded"
282
+ })).css,
283
+ description: `Generated CSS custom properties for a complete ${variant} ${designSystem} theme`,
284
+ angularCaveat: isAngular
285
+ };
286
+ } catch (error) {
287
+ const message = error instanceof Error ? error.message : String(error);
288
+ throw new Error(`Failed to compile theme CSS: ${message}`);
289
+ }
290
+ }
161
291
  //#endregion
162
- export { formatCssOutput, generateComponentThemeCss, generateCustomPaletteCss, generatePaletteCss };
292
+ export { formatCssOutput, generateComponentThemeCss, generateCustomPaletteCss, generateElevationsCss, generatePaletteCss, generateThemeCss, generateTypographyCss };
package/dist/mcp/index.js CHANGED
@@ -33,7 +33,7 @@ import { z } from "zod";
33
33
  function createServer() {
34
34
  const server = new McpServer({
35
35
  name: "igniteui-theming",
36
- version: "v27.3.0",
36
+ version: "v27.4.0",
37
37
  description: "Generate Sass theming code for Ignite UI components - create palettes, typography, elevations, and complete themes"
38
38
  });
39
39
  registerTools(server);
@@ -101,7 +101,8 @@ function registerTools(server) {
101
101
  fontFamily: createTypographySchema.shape.fontFamily,
102
102
  designSystem: createTypographySchema.shape.designSystem,
103
103
  customScale: createTypographySchema.shape.customScale,
104
- name: createTypographySchema.shape.name
104
+ name: createTypographySchema.shape.name,
105
+ output: createTypographySchema.shape.output
105
106
  }
106
107
  }, withPreprocessing(createTypographySchema, handleCreateTypography));
107
108
  server.registerTool("create_elevations", {
@@ -111,7 +112,8 @@ function registerTools(server) {
111
112
  platform: createElevationsSchema.shape.platform,
112
113
  licensed: createElevationsSchema.shape.licensed,
113
114
  designSystem: createElevationsSchema.shape.designSystem,
114
- name: createElevationsSchema.shape.name
115
+ name: createElevationsSchema.shape.name,
116
+ output: createElevationsSchema.shape.output
115
117
  }
116
118
  }, async (params) => {
117
119
  return handleCreateElevations(createElevationsSchema.parse(params));
@@ -131,7 +133,8 @@ function registerTools(server) {
131
133
  fontFamily: createThemeSchema.shape.fontFamily,
132
134
  includeTypography: createThemeSchema.shape.includeTypography,
133
135
  includeElevations: createThemeSchema.shape.includeElevations,
134
- includeSpacing: createThemeSchema.shape.includeSpacing
136
+ includeSpacing: createThemeSchema.shape.includeSpacing,
137
+ output: createThemeSchema.shape.output
135
138
  }
136
139
  }, async (params) => {
137
140
  return await handleCreateTheme(createThemeSchema.parse(params));
@@ -1484,6 +1484,16 @@ var navdrawer = {
1484
1484
  "name": "item-border-radius",
1485
1485
  "type": "List",
1486
1486
  "description": "The border radius used for the navdrawer item."
1487
+ },
1488
+ {
1489
+ "name": "size",
1490
+ "type": "Number",
1491
+ "description": "The width of the navigation drawer in its expanded (full) state."
1492
+ },
1493
+ {
1494
+ "name": "size--mini",
1495
+ "type": "Number",
1496
+ "description": "The width of the navigation drawer in its mini state."
1487
1497
  }
1488
1498
  ]
1489
1499
  };
@@ -40,12 +40,12 @@ export declare const FRAGMENTS: {
40
40
  * These are shown to AI models when listing available tools.
41
41
  */
42
42
  export declare const TOOL_DESCRIPTIONS: {
43
- readonly detect_platform: "Detect the target platform by analyzing dependencies and project config files.\n\n<use_case>\n Use this tool FIRST before generating any theme code to ensure platform-optimized output.\n The detected platform determines the correct Sass module paths and syntax.\n</use_case>\n\n<detection_signals>\n Uses multi-signal detection with confidence scoring:\n 1. Ignite UI packages (HIGH - 100): igniteui-angular, igniteui-webcomponents, igniteui-react, IgniteUI.Blazor\n 2. Config files (MEDIUM-HIGH - 80): angular.json, vite.config.*, next.config.*, .csproj\n 3. Framework packages (LOW - 40): @angular/core, react, lit (fallback only)\n 4. Generic fallback: When no Ignite UI product is found, returns \"generic\" for standalone theming\n</detection_signals>\n\n<output>\n Returns:\n - platform: \"angular\" | \"webcomponents\" | \"react\" | \"blazor\" | \"generic\" | null\n - confidence: \"high\" | \"medium\" | \"low\" | \"none\"\n - ambiguous: true if multiple Ignite UI platforms detected (requires user to specify explicitly)\n - alternatives: Array of detected platforms when ambiguous\n - signals: Array of detection signals found\n - detectedPackage: The primary package that triggered detection\n - platformInfo: Name, theming module path, and description\n\n \"generic\" means no Ignite UI product framework was found. Most tools work in generic mode\n (palette, typography, elevations, theme generation, color references, layout tokens with scope).\n Component-specific tools (create_component_theme, get_component_design_tokens) are NOT available\n in generic mode. The response includes Sass load path guidance based on detected build tooling.\n null is reserved for error states (package.json read failure) or ambiguous multi-product detection.\n</output>\n\n<ambiguous_handling>\n When multiple Ignite UI platforms are detected with significant confidence (≥60), returns:\n - platform: null\n - ambiguous: true\n - alternatives: List of possible platforms with their signals\n - Action: User must specify platform explicitly in subsequent tool calls\n</ambiguous_handling>\n\n<related_tools>\n After detection, use the platform value with:\n - create_palette: Generate color palette\n - create_theme: Generate complete theme\n - create_typography: Set up typography\n - create_elevations: Configure shadows\n</related_tools>\n\n<related_resources>\n - \"theming://guidance/platform-setup\": Comprehensive setup guide covering detection workflow, Sass load path configuration, dependency handling, and the recommended theming sequence. Read this for detailed platform-specific setup instructions.\n</related_resources>";
43
+ readonly detect_platform: "Detect the target platform by analyzing dependencies and project config files.\n\n<use_case>\n Use this tool FIRST before generating any theme code to ensure platform-optimized output.\n The detected platform determines the correct Sass module paths and syntax.\n Output format (\"sass\" vs \"css\") is a separate concern — see the output parameter on each\n generation tool. For non-Angular platforms, prefer \"css\" unless the project has a confirmed\n Sass pipeline; use your own file-reading tools or ask the user to confirm before choosing\n output: \"sass\".\n</use_case>\n\n<detection_signals>\n Uses multi-signal detection with confidence scoring:\n 1. Ignite UI packages (HIGH - 100): igniteui-angular, igniteui-webcomponents, igniteui-react, IgniteUI.Blazor\n 2. Config files (MEDIUM-HIGH - 80): angular.json, vite.config.*, next.config.*, .csproj\n 3. Framework packages (LOW - 40): @angular/core, react, lit (fallback only)\n 4. Generic fallback: When no Ignite UI product is found, returns \"generic\" for standalone theming\n</detection_signals>\n\n<output>\n Returns:\n - platform: \"angular\" | \"webcomponents\" | \"react\" | \"blazor\" | \"generic\" | null\n - confidence: \"high\" | \"medium\" | \"low\" | \"none\"\n - ambiguous: true if multiple Ignite UI platforms detected (requires user to specify explicitly)\n - alternatives: Array of detected platforms when ambiguous\n - signals: Array of detection signals found\n - detectedPackage: The primary package that triggered detection\n - platformInfo: Name, theming module path, and description\n\n \"generic\" means no Ignite UI product framework was found. Most tools work in generic mode\n (palette, typography, elevations, theme generation, color references, layout tokens with scope).\n Component-specific tools (create_component_theme, get_component_design_tokens) are NOT available\n in generic mode. The response includes Sass load path guidance based on detected build tooling.\n null is reserved for error states (package.json read failure) or ambiguous multi-product detection.\n</output>\n\n<ambiguous_handling>\n When multiple Ignite UI platforms are detected with significant confidence (≥60), returns:\n - platform: null\n - ambiguous: true\n - alternatives: List of possible platforms with their signals\n - Action: User must specify platform explicitly in subsequent tool calls\n</ambiguous_handling>\n\n<related_tools>\n After detection, use the platform value with:\n - create_palette: Generate color palette\n - create_theme: Generate complete theme\n - create_typography: Set up typography\n - create_elevations: Configure shadows\n</related_tools>\n\n<related_resources>\n - \"theming://guidance/platform-setup\": Comprehensive setup guide covering detection workflow, Sass load path configuration, dependency handling, and the recommended theming sequence. Read this for detailed platform-specific setup instructions.\n</related_resources>";
44
44
  readonly create_palette: "Generate a color palette for Ignite UI themes using the palette() Sass function.\n\n<use_case>\n Use this tool when you have base colors and want to auto-generate a complete palette\n with all shade variations (50-900, A100-A700). Best for colors with mid-range luminance\n that will produce good automatic shade distribution.\n</use_case>\n\n<output_formats>\n - \"sass\" (default): Generates Sass code using the palette() function. Requires Sass compilation.\n - \"css\": Generates CSS custom properties (variables) directly. Ready to use in any CSS file.\n\n Use \"css\" output when:\n - Working with vanilla CSS projects without Sass\n - You want immediately usable CSS variables\n - Using CSS-in-JS or other non-Sass styling approaches\n</output_formats>\n\n<workflow>\n 1. Validates input colors against the theme variant\n 2. Analyzes color luminance for shade generation suitability\n 3. Generates Sass code OR compiles to CSS based on output parameter\n 4. Adds warning comments to code if issues detected\n 5. Returns validation warnings and tips in response\n</workflow>\n\n<important_notes>\n - Requires primary, secondary, and surface colors (matches Sass palette() API)\n - Gray, info, success, warn, error are optional (use design system defaults)\n - Surface color should match variant: light colors for \"light\", dark for \"dark\"\n - Colors with extreme luminance (< 0.05 or > 0.45) may produce suboptimal automatic shade generation.\n\n SHADE PROGRESSION (important):\n - Primary, secondary, and all chromatic colors: shades are NEVER inverted.\n The palette() function always generates 50=lightest to 900=darkest.\n - Only gray shades behave differently based on variant (for text contrast).\n - DO NOT manually invert primary/secondary colors for dark themes.\n\n SASS FILE PLACEMENT:\n - When combining Sass output from multiple tools into one file, all @use rules\n must appear at the top before any other statements. Deduplicate @use lines\n that share the same module path.\n</important_notes>\n\n<output>\n Returns:\n - Generated Sass code with palette() function call, OR\n - Generated CSS with custom properties (:root { --ig-primary-50: ...; })\n - Platform-specific module imports (Sass only)\n - Validation warnings (if any colors have issues)\n - Variable name created (e.g., $my-palette) (Sass only)\n</output>\n\n<error_handling>\n - Invalid color format: Returns error with format examples\n - Variant mismatch: Warns if surface color doesn't match theme variant\n - Luminance issues: Warns with recommendation to use create_custom_palette\n</error_handling>\n\n<example>\n Blue brand with orange accent on light theme (Sass output):\n {\n \"primary\": \"#1976D2\",\n \"secondary\": \"#FF9800\",\n \"surface\": \"#FAFAFA\",\n \"variant\": \"light\"\n }\n\n Same palette as CSS variables:\n {\n \"primary\": \"#1976D2\",\n \"secondary\": \"#FF9800\",\n \"surface\": \"#FAFAFA\",\n \"variant\": \"light\",\n \"output\": \"css\"\n }\n</example>\n\n<related_tools>\n - detect_platform: Run first to get correct platform value\n - create_custom_palette: Use if this tool warns about luminance issues\n - create_theme: Use instead if you want palette + typography + elevations together\n</related_tools>\n\n<related_resources>\n Call read_resource to load reference data:\n - \"theming://presets/palettes\" — preset palette colors\n - \"theming://guidance/colors\" — color guidance overview\n - \"theming://guidance/colors/rules\" — light/dark theme color rules\n</related_resources>";
45
45
  readonly create_custom_palette: "Generate a custom color palette with fine-grained control over individual shade values.\n\n⚠️ CRITICAL RULES - READ BEFORE GENERATING SHADES:\n1. MONOCHROMATIC: Each color (primary, secondary, etc.) must use ONE HUE only.\n All 14 shades are lighter/darker versions of the SAME color.\n Example: primary blue → all shades must be blue (#E3F2FD light → #0D47A1 dark).\n WRONG: mixing blue, green, purple in one color's shades.\n2. NEVER INVERT: Chromatic colors always go 50=lightest → 900=darkest.\n This applies to BOTH light and dark themes. Only gray inverts for dark themes.\n\n<use_case>\n Use this tool when:\n - The standard palette() function produces suboptimal shade distribution\n - You have brand guidelines specifying exact color values for each shade\n - Base colors are too light (luminance > 0.45) or too dark (< 0.05)\n - You have specific accessibility audit requirements with exact contrast color values (rare - auto-generated contrast is usually sufficient)\n - You want to mix auto-generated and manually specified color groups\n</use_case>\n\n<output_formats>\n - \"sass\" (default): Generates Sass code with palette map structure. Requires Sass compilation.\n - \"css\": Generates CSS custom properties (variables) directly. Ready to use in any CSS file.\n\n Use \"css\" output when:\n - Working with vanilla CSS projects without Sass\n - You want immediately usable CSS variables\n - Building prototypes or quick demos\n - Using CSS-in-JS or other non-Sass styling approaches\n</output_formats>\n\n<workflow>\n 1. For each color group, choose a mode:\n - mode:\"shades\" → Auto-generate all shades from baseColor using shades() function\n - mode:\"explicit\" → Manually specify every shade value\n 2. Validates all explicit shades for:\n - Completeness: All required shades present\n - Color format: Valid CSS color values\n - Luminance progression: 50 lightest → 900 darkest (chromatic colors)\n - Hue consistency: All shades within ±30° hue tolerance (monochromatic)\n 3. Generates Sass code with color() map structure\n 4. Returns any validation warnings\n</workflow>\n\n<important_notes>\n CRITICAL - SHADE PROGRESSION RULES:\n - CHROMATIC colors (primary, secondary, surface, info, success, warn, error):\n Shade 50 = ALWAYS lightest, shade 900 = ALWAYS darkest.\n This is TRUE FOR BOTH light AND dark themes. NEVER invert chromatic colors.\n - GRAY color ONLY: Inverts for dark themes (50=darkest, 900=lightest).\n - DO NOT confuse these rules. Only gray inverts, never primary/secondary/etc.\n\n ⚠️ CRITICAL - MONOCHROMATIC REQUIREMENT:\n Each color group (primary, secondary, etc.) must contain shades of ONE COLOR ONLY.\n Shades are lighter/darker variations of the SAME hue - NOT different colors!\n\n CORRECT example for primary blue:\n 50: \"#E3F2FD\" (very light blue)\n 500: \"#2196F3\" (medium blue)\n 900: \"#0D47A1\" (dark blue)\n → All shades are BLUE, just different lightness levels\n\n WRONG example (DO NOT DO THIS):\n 50: \"#E3F2FD\" (light blue)\n 500: \"#4CAF50\" (green) ← WRONG! Different hue\n 900: \"#9C27B0\" (purple) ← WRONG! Different hue\n → This creates a rainbow, not a shade palette\n\n Rule: Keep hue constant (±30° tolerance), vary only lightness and saturation.\n\n CHROMATIC COLORS (primary, secondary, surface, info, success, warn, error):\n - Explicit mode requires 14 shades required: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400, A700\n - Shade 50 = lightest, shade 900 = darkest (SAME for light AND dark themes)\n - ALL shades must be the SAME HUE (monochromatic) - see requirement above\n - A100-A700 are accent shades (same hue, typically more saturated)\n\n GRAY COLOR (the ONLY color that inverts):\n - Explicit mode requires 10 shades required: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900\n - LIGHT themes: 50 = lightest (near white), 900 = darkest (near black)\n - DARK themes: 50 = darkest, 900 = lightest (INVERTED progression)\n - Gray inverts because text/UI elements need to contrast against the surface\n\n CONTRAST COLORS (AUTO-GENERATED - DO NOT PROVIDE):\n - DO NOT include contrastOverrides in your input - OMIT THIS FIELD ENTIRELY\n - The system AUTOMATICALLY generates contrast colors using adaptive-contrast()\n - For each shade, the generated Sass output will include:\n '500': #4CAF50,\n '500-contrast': adaptive-contrast(#4CAF50), ← AUTO-GENERATED\n '500-raw': #4CAF50,\n - The adaptive-contrast() function auto-selects black or white for readability\n - Only provide contrastOverrides if you have a specific accessibility audit\n requiring exact contrast color values (this is extremely rare)\n\n MIXING MODES:\n - You can use \"shades\" mode for some colors and \"explicit\" for others\n - Example: explicit primary, shades-based secondary and surface\n\n SASS FILE PLACEMENT:\n - When combining Sass output from multiple tools into one file, all @use rules\n must appear at the top before any other statements. Deduplicate @use lines\n that share the same module path.\n</important_notes>\n\n<output>\n Returns:\n - Generated Sass code with color() map definitions, OR\n - Generated CSS with custom properties (:root { --ig-primary-50: ...; })\n - Summary of which colors use shades() vs explicit values\n - Variable name created (e.g., $custom-light-palette) (Sass only)\n - Validation warnings (if any)\n</output>\n\n<error_handling>\n Validation FAILS (returns error, no code generated) if:\n - Missing required shades in explicit mode\n - Invalid CSS color format in any shade\n\n Validation WARNS (generates code with warnings) if:\n - Luminance progression incorrect (50 darker than 900)\n - Hue inconsistency detected (shades not monochromatic)\n - Gray progression doesn't match variant (light vs dark)\n</error_handling>\n\n<example>\n Brand green with exact shades (NOTE: ALL shades are GREEN - same hue, different lightness):\n\n INPUT (what you provide - NO contrastOverrides needed):\n {\n \"variant\": \"light\",\n \"primary\": {\n \"mode\": \"explicit\",\n \"shades\": {\n \"50\": \"#E8F5E9\",\n \"100\": \"#C8E6C9\",\n \"200\": \"#A5D6A7\",\n \"300\": \"#81C784\",\n \"400\": \"#66BB6A\",\n \"500\": \"#4CAF50\",\n \"600\": \"#43A047\",\n \"700\": \"#388E3C\",\n \"800\": \"#2E7D32\",\n \"900\": \"#1B5E20\",\n \"A100\": \"#B9F6CA\",\n \"A200\": \"#69F0AE\",\n \"A400\": \"#00E676\",\n \"A700\": \"#00C853\"\n }\n // ↑ Only provide shades - contrast colors are AUTO-GENERATED\n },\n \"secondary\": { \"mode\": \"shades\", \"baseColor\": \"#FF9800\" },\n \"surface\": { \"mode\": \"shades\", \"baseColor\": \"#FAFAFA\" }\n }\n\n GENERATED OUTPUT (contrast colors added automatically):\n 'primary': (\n '500': #4CAF50,\n '500-contrast': adaptive-contrast(#4CAF50), // ← AUTO-GENERATED\n '500-raw': #4CAF50, // ← AUTO-GENERATED\n // ... same pattern for all 14 shades\n )\n</example>\n\n<related_tools>\n - detect_platform: Run first to get correct platform value\n - create_palette: Use for simpler cases with mid-range luminance colors\n - create_theme: Does not support custom palettes; use this tool + manual theme assembly\n</related_tools>\n\n<anti_example>\n ❌ WRONG - DO NOT create shades like this (different hues = broken palette):\n {\n \"primary\": {\n \"mode\": \"explicit\",\n \"shades\": {\n \"50\": \"#E3F2FD\", // blue\n \"100\": \"#DCEDC8\", // green ← WRONG HUE\n \"200\": \"#FFF9C4\", // yellow ← WRONG HUE\n \"500\": \"#9C27B0\", // purple ← WRONG HUE\n \"900\": \"#BF360C\" // red-brown ← WRONG HUE\n }\n }\n }\n This creates a rainbow, not a shade palette. Components will look broken.\n</anti_example>\n\n<related_resources>\n Call read_resource to load reference data:\n - \"theming://presets/palettes\" — preset palette colors for reference\n - \"theming://guidance/colors/usage\" — which shades to use for different purposes\n - \"theming://guidance/colors/roles\" — semantic meaning of each color family\n</related_resources>";
46
46
  readonly create_typography: "Set up typography for Ignite UI themes with custom font families and type scales.\n\n<use_case>\n Use this tool to configure fonts that match your brand identity while maintaining\n consistent sizing, line heights, and letter spacing based on design system conventions.\n</use_case>\n\n<workflow>\n 1. Takes font family string and optional design system preset\n 2. Generates Sass code using the typography() mixin\n 3. Applies the type scale from the selected design system\n 4. Optionally applies custom scale overrides\n</workflow>\n\n<important_notes>\n - Font family string should include fallbacks for cross-platform compatibility\n - Quote font names that contain spaces: '\"Segoe UI\"' not 'Segoe UI'\n - Design system affects: font sizes, line heights, letter spacing, font weights\n - Type styles include: h1-h6, subtitle-1/2, body-1/2, button, caption, overline\n\n SASS FILE PLACEMENT:\n - When combining Sass output from multiple tools into one file, all @use rules\n must appear at the top before any other statements. Deduplicate @use lines\n that share the same module path.\n</important_notes>\n\n<output>\n Returns:\n - Generated Sass code with typography() mixin call\n - Platform-specific module imports\n - Variable name used (e.g., $my-typography)\n</output>\n\n<error_handling>\n - Empty font family: Returns error requesting valid font family string\n</error_handling>\n\n<example>\n Modern sans-serif typography for Material Design:\n {\n \"fontFamily\": \"'Inter', 'Segoe UI', 'Helvetica Neue', sans-serif\",\n \"designSystem\": \"material\"\n }\n</example>\n\n<related_tools>\n - detect_platform: Run first to get correct platform value\n - create_theme: Use instead if you want typography + palette + elevations together\n</related_tools>\n\n<related_resources>\n Call read_resource to load reference data:\n - \"theming://presets/typography\" — typography presets for all design systems\n</related_resources>";
47
47
  readonly create_elevations: "Set up elevation shadows for Ignite UI themes.\n\n<use_case>\n Use this tool to configure box-shadow values that provide visual depth and hierarchy.\n Elevations follow Material Design or Indigo design specifications.\n</use_case>\n\n<workflow>\n 1. Selects elevation preset based on design system parameter\n 2. Generates Sass code using the elevations() mixin\n 3. Creates 24 elevation levels (0-24) with corresponding shadow values\n</workflow>\n\n<important_notes>\n - \"material\" preset: Material Design 3 shadow specifications\n - \"indigo\" preset: Infragistics Indigo shadow specifications\n - Elevation 0 = no shadow, elevation 24 = maximum shadow depth\n - Components use elevation() function to apply specific levels\n\n SASS FILE PLACEMENT:\n - When combining Sass output from multiple tools into one file, all @use rules\n must appear at the top before any other statements. Deduplicate @use lines\n that share the same module path.\n</important_notes>\n\n<output>\n Returns:\n - Generated Sass code with elevations() mixin call\n - Platform-specific module imports\n - Variable name used (e.g., $my-elevations)\n</output>\n\n<related_tools>\n - detect_platform: Run first to get correct platform value\n - create_theme: Use instead if you want elevations + palette + typography together\n</related_tools>\n\n<related_resources>\n Call read_resource to load reference data:\n - \"theming://presets/elevations\" — elevation presets for Material and Indigo\n</related_resources>";
48
- readonly create_theme: "Generate a complete, production-ready Ignite UI theme with palette, typography, and elevations.\n\n<use_case>\n Use this tool as the starting point for new projects. It generates everything needed\n for a working theme in a single operation: color palette, typography setup, elevation\n shadows, and the theme application mixin.\n</use_case>\n\n<workflow>\n 1. Analyzes input colors for palette shade generation suitability\n 2. Creates color palette using palette() function\n 3. Sets up typography with specified font family (if includeTypography: true)\n 4. Configures elevations based on design system (if includeElevations: true)\n 5. Configures spacing utilities for Web Components (if includeSpacing: true)\n 6. Applies the theme using the theme() mixin\n 7. Returns luminance warnings if any colors may produce poor shades\n</workflow>\n\n<important_notes>\n REQUIRED COLORS:\n - primaryColor: Main brand color\n - secondaryColor: Accent/highlight color\n - surfaceColor: Background color (should match variant)\n\n SHADE PROGRESSION (important):\n - Primary and secondary colors are NEVER inverted between light/dark themes.\n - The palette() function generates shades 50=lightest to 900=darkest for ALL\n chromatic colors regardless of theme variant.\n - Only gray shades behave differently (for text contrast against surface).\n - DO NOT provide inverted primary/secondary colors for dark themes.\n\n LUMINANCE ANALYSIS:\n - Colors with extreme luminance (< 0.05 or > 0.45) may produce suboptimal automatic shade generation.\n - If warnings appear, consider using create_custom_palette for those colors\n\n PLATFORM DIFFERENCES:\n - Angular: Uses igniteui-angular/theming with core() and theme() mixins\n - Web Components: Uses igniteui-theming directly with palette(), typography(), elevations() mixins\n - React: Uses igniteui-theming directly (same as Web Components), common with Vite/Next.js\n - Blazor: Uses igniteui-theming for Sass compilation, theme CSS referenced in Blazor components\n\n SASS FILE PLACEMENT:\n - When combining Sass output from multiple tools into one file, all @use rules\n must appear at the top before any other statements. Deduplicate @use lines\n that share the same module path.\n</important_notes>\n\n<output>\n Returns:\n - Complete Sass code with all theme components\n - Luminance analysis warnings (if applicable)\n - List of variables created/used\n - Platform-specific guidance\n</output>\n\n<error_handling>\n - Invalid color format: Returns error with format examples\n - Luminance issues: Warns but still generates code (may produce suboptimal shades)\n - Variant mismatch: Warns if surface color doesn't match theme variant\n</error_handling>\n\n<example>\n Complete Material Design blue theme:\n {\n \"platform\": \"angular\",\n \"designSystem\": \"material\",\n \"primaryColor\": \"#1976D2\",\n \"secondaryColor\": \"#FF9800\",\n \"surfaceColor\": \"#FAFAFA\",\n \"variant\": \"light\",\n \"fontFamily\": \"'Roboto', sans-serif\",\n \"includeTypography\": true,\n \"includeElevations\": true\n }\n</example>\n\n<next_steps>\n After generating a theme:\n 1. Review any luminance warnings in the output\n 2. If warnings suggest shade generation issues:\n - Use create_custom_palette for problematic colors\n - Manually assemble theme with custom palette\n 3. Import the generated Sass file in your application's main styles\n 4. Customize individual component themes as needed using component schema overrides\n</next_steps>\n\n<related_tools>\n - detect_platform: Run first to auto-detect platform from package.json\n - create_custom_palette: Use for colors that produce luminance warnings\n - create_palette: Use if you only need a palette without full theme\n - create_typography: Use if you only need typography setup\n - create_elevations: Use if you only need elevation shadows\n</related_tools>\n\n <related_resources>\n Call read_resource to load reference data:\n - \"theming://presets/palettes\" — preset palette colors\n - \"theming://guidance/colors\" — color guidance overview\n - \"theming://guidance/colors/rules\" — light/dark theme color rules\n - \"theming://platforms/angular\" — Angular platform configuration\n - \"theming://platforms/webcomponents\" — Web Components platform configuration\n - \"theming://platforms/react\" — React platform configuration\n - \"theming://platforms/blazor\" — Blazor platform configuration\n </related_resources>";
48
+ readonly create_theme: "Generate a complete, production-ready Ignite UI theme with palette, typography, and elevations.\n\n<use_case>\n Use this tool as the starting point for new projects. It generates everything needed\n for a working theme in a single operation: color palette, typography setup, elevation\n shadows, and the theme application mixin.\n</use_case>\n\n<workflow>\n 1. Analyzes input colors for palette shade generation suitability\n 2. Creates color palette using palette() function\n 3. Sets up typography with specified font family (if includeTypography: true)\n 4. Configures elevations based on design system (if includeElevations: true)\n 5. Configures spacing utilities for Web Components, React, and Blazor (if includeSpacing: true)\n 6. Applies the theme using the theme() mixin\n 7. Returns luminance warnings if any colors may produce poor shades\n</workflow>\n\n<important_notes>\n REQUIRED COLORS:\n - primaryColor: Main brand color\n - secondaryColor: Accent/highlight color\n - surfaceColor: Background color (should match variant)\n\n SHADE PROGRESSION (important):\n - Primary and secondary colors are NEVER inverted between light/dark themes.\n - The palette() function generates shades 50=lightest to 900=darkest for ALL\n chromatic colors regardless of theme variant.\n - Only gray shades behave differently (for text contrast against surface).\n - DO NOT provide inverted primary/secondary colors for dark themes.\n\n LUMINANCE ANALYSIS:\n - Colors with extreme luminance (< 0.05 or > 0.45) may produce suboptimal automatic shade generation.\n - If warnings appear, consider using create_custom_palette for those colors\n\n PLATFORM DIFFERENCES:\n - Angular: Uses igniteui-angular/theming with core() and theme() mixins\n - Web Components: Uses igniteui-theming directly with palette(), typography(), elevations() mixins\n - React: Uses igniteui-theming directly (same as Web Components), common with Vite/Next.js\n - Blazor: Uses igniteui-theming for Sass compilation, theme CSS referenced in Blazor components\n\n SASS FILE PLACEMENT:\n - When combining Sass output from multiple tools into one file, all @use rules\n must appear at the top before any other statements. Deduplicate @use lines\n that share the same module path.\n</important_notes>\n\n<output>\n Returns:\n - Complete Sass code with all theme components\n - Luminance analysis warnings (if applicable)\n - List of variables created/used\n - Platform-specific guidance\n</output>\n\n<error_handling>\n - Invalid color format: Returns error with format examples\n - Luminance issues: Warns but still generates code (may produce suboptimal shades)\n - Variant mismatch: Warns if surface color doesn't match theme variant\n</error_handling>\n\n<example>\n Complete Material Design blue theme:\n {\n \"platform\": \"angular\",\n \"designSystem\": \"material\",\n \"primaryColor\": \"#1976D2\",\n \"secondaryColor\": \"#FF9800\",\n \"surfaceColor\": \"#FAFAFA\",\n \"variant\": \"light\",\n \"fontFamily\": \"'Roboto', sans-serif\",\n \"includeTypography\": true,\n \"includeElevations\": true\n }\n</example>\n\n<next_steps>\n After generating a theme:\n 1. Review any luminance warnings in the output\n 2. If warnings suggest shade generation issues:\n - Use create_custom_palette for problematic colors\n - Manually assemble theme with custom palette\n 3. Import the generated Sass file in your application's main styles\n 4. Customize individual component themes as needed using component schema overrides\n</next_steps>\n\n<related_tools>\n - detect_platform: Run first to auto-detect platform from package.json\n - create_custom_palette: Use for colors that produce luminance warnings\n - create_palette: Use if you only need a palette without full theme\n - create_typography: Use if you only need typography setup\n - create_elevations: Use if you only need elevation shadows\n</related_tools>\n\n <related_resources>\n Call read_resource to load reference data:\n - \"theming://presets/palettes\" — preset palette colors\n - \"theming://guidance/colors\" — color guidance overview\n - \"theming://guidance/colors/rules\" — light/dark theme color rules\n - \"theming://platforms/angular\" — Angular platform configuration\n - \"theming://platforms/webcomponents\" — Web Components platform configuration\n - \"theming://platforms/react\" — React platform configuration\n - \"theming://platforms/blazor\" — Blazor platform configuration\n </related_resources>";
49
49
  readonly set_size: "Set global or component-specific sizing by updating --ig-size.\n\n<use_case>\n Use this tool for requests like:\n - \"Make the calendar smaller\"\n - \"The buttons feel too big\"\n - \"Use the small size everywhere\"\n</use_case>\n\n<behavior>\n - Sets --ig-size in the chosen scope (defaults to :root)\n - Accepts \"small\", \"medium\", \"large\" (mapped to 1, 2, 3) or numeric values\n - When platform is \"generic\", do NOT use the \"component\" parameter (it resolves Ignite UI component selectors). Use \"scope\" with a custom CSS selector instead, or omit both for :root.\n</behavior>\n\n<sass_notes>\n - Components map --ig-size to --component-size internally\n - Styles using sizable() require @include sizable() in component styles\n</sass_notes>\n\n<example>\n Make flat buttons medium:\n {\n \"component\": \"flat-button\",\n \"size\": \"medium\"\n }\n\n Make everything small globally:\n {\n \"size\": \"small\"\n }\n</example>\n\n<related_resources>\n Call read_resource to load reference data:\n - \"theming://docs/spacing-and-sizing\" — spacing and sizing overview\n - \"theming://docs/functions/sizable\" — sizable value function\n - \"theming://docs/mixins/sizable\" — sizable mixin\n</related_resources>";
50
50
  readonly set_spacing: "Set global or component-specific spacing by updating --ig-spacing.\n\n<use_case>\n Use this tool for requests like:\n - \"The button feels bloated\"\n - \"Tighten the spacing on the form\"\n - \"Double the padding on cards\"\n</use_case>\n\n<behavior>\n - Sets --ig-spacing in the chosen scope (defaults to :root)\n - Optional overrides for --ig-spacing-inline and --ig-spacing-block\n - 0 = no spacing, 1 = default, 2 = double (fractions allowed)\n - spacing is required; inline/block are optional overrides\n - When platform is \"generic\", do NOT use the \"component\" parameter (it resolves Ignite UI component selectors). Use \"scope\" with a custom CSS selector instead, or omit both for :root.\n</behavior>\n\n<sass_notes>\n - pad(), pad-inline(), pad-block() require @include spacing() once\n</sass_notes>\n\n<example>\n Reduce calendar spacing:\n {\n \"component\": \"calendar\",\n \"spacing\": 0.75\n }\n\n Override inline spacing:\n {\n \"scope\": \".compact\",\n \"inline\": 0.5,\n \"block\": 0.75\n }\n</example>\n\n<related_resources>\n Call read_resource to load reference data:\n - \"theming://docs/spacing-and-sizing\" — spacing and sizing overview\n - \"theming://docs/functions/pad\" — pad spacing function\n - \"theming://docs/mixins/spacing\" — spacing mixin\n</related_resources>";
51
51
  readonly set_roundness: "Set global or component-specific roundness by updating --ig-radius-factor.\n\n<use_case>\n Use this tool for requests like:\n - \"Make the flat buttons more round\"\n - \"Square off the cards\"\n</use_case>\n\n<behavior>\n - Sets --ig-radius-factor in the chosen scope (defaults to :root)\n - 0 = minimum radius, 1 = maximum radius, values between interpolate\n - When platform is \"generic\", do NOT use the \"component\" parameter (it resolves Ignite UI component selectors). Use \"scope\" with a custom CSS selector instead, or omit both for :root.\n</behavior>\n\n<sass_notes>\n - border-radius() responds to --ig-radius-factor without extra mixins\n</sass_notes>\n\n<example>\n Round avatars more:\n {\n \"component\": \"avatar\",\n \"radiusFactor\": 0.9\n }\n\n Globally reduce roundness:\n {\n \"radiusFactor\": 0.8\n }\n</example>\n\n<related_resources>\n Call read_resource to load reference data:\n - \"theming://docs/spacing-and-sizing\" — spacing and sizing overview\n - \"theming://docs/functions/border-radius\" — border radius function\n</related_resources>";
@@ -64,7 +64,7 @@ export declare const PARAM_DESCRIPTIONS: {
64
64
  readonly variant: "Theme variant: \"light\" (light backgrounds, dark text) or \"dark\" (dark backgrounds, light text). Defaults to \"light\".";
65
65
  readonly designSystem: "Design system preset: \"material\" (Material Design), \"bootstrap\" (Bootstrap), \"fluent\" (Microsoft Fluent), or \"indigo\" (Infragistics Indigo). Defaults to \"material\".";
66
66
  readonly name: "Custom variable name (without $ prefix). If omitted, auto-generates based on tool and variant (e.g., \"custom-light\", \"my-theme\").";
67
- readonly output: "Output format: \"sass\" generates Sass code using igniteui-theming library functions. \"css\" generates CSS custom properties (variables) directly - useful for vanilla CSS projects or when you don't want Sass compilation. Defaults to tool-specific output (\"sass\" for theme generators, \"css\" for layout setters).";
67
+ readonly output: "Output format for the generated code.\n\n\"sass\" Returns Sass source using igniteui-theming functions and mixins. Requires a Sass pipeline in the consuming project. Prefer for Angular (Angular CLI handles Sass compilation automatically).\n\n\"css\" The MCP server compiles the Sass internally and returns ready-to-use CSS custom properties. No local Sass toolchain needed. Prefer for Web Components, React, and Blazor unless the project has a confirmed Sass setup (e.g. .scss files and a sass build step are present). When in doubt, use \"css\" or ask the user.\n\nLayout tools (set_size, set_spacing, set_roundness) default to \"css\". Generation tools (create_palette, create_theme, etc.) default to \"sass\" for Angular and \"css\" for all other platforms.";
68
68
  readonly packageJsonPath: "Path to package.json file, relative to current working directory. Defaults to \"./package.json\".";
69
69
  readonly primary: "Primary brand color - used for main actions, active states, and emphasis. Valid CSS color formats: hex (\"#3F51B5\", \"#3F51B5AA\"), rgb/rgba (\"rgb(63, 81, 181)\", \"rgb(63 81 181 / 0.5)\"), hsl/hsla (\"hsl(231, 48%, 48%)\", \"hsl(231 48% 48% / 0.5)\"), hwb (\"hwb(231 20% 30%)\"), lab/lch (\"lab(50% 40 59)\", \"lch(50% 80 30)\"), oklab/oklch (\"oklab(59% 0.1 0.1)\", \"oklch(60% 0.15 50)\"), color() for wide-gamut (\"color(display-p3 1 0.5 0)\"), or CSS named colors (\"indigo\", \"rebeccapurple\").";
70
70
  readonly secondary: "Secondary/accent color - used for FABs, selection controls, highlights. Valid CSS color formats: hex (\"#3F51B5\", \"#3F51B5AA\"), rgb/rgba (\"rgb(63, 81, 181)\", \"rgb(63 81 181 / 0.5)\"), hsl/hsla (\"hsl(231, 48%, 48%)\", \"hsl(231 48% 48% / 0.5)\"), hwb (\"hwb(231 20% 30%)\"), lab/lch (\"lab(50% 40 59)\", \"lch(50% 80 30)\"), oklab/oklch (\"oklab(59% 0.1 0.1)\", \"oklch(60% 0.15 50)\"), color() for wide-gamut (\"color(display-p3 1 0.5 0)\"), or CSS named colors (\"indigo\", \"rebeccapurple\").";
@@ -82,7 +82,7 @@ export declare const PARAM_DESCRIPTIONS: {
82
82
  readonly surfaceColor: "Surface/background color for the theme. Use light colors (#FAFAFA) for \"light\" variant, dark colors (#121212) for \"dark\" variant. Valid CSS color formats: hex (\"#3F51B5\", \"#3F51B5AA\"), rgb/rgba (\"rgb(63, 81, 181)\", \"rgb(63 81 181 / 0.5)\"), hsl/hsla (\"hsl(231, 48%, 48%)\", \"hsl(231 48% 48% / 0.5)\"), hwb (\"hwb(231 20% 30%)\"), lab/lch (\"lab(50% 40 59)\", \"lch(50% 80 30)\"), oklab/oklch (\"oklab(59% 0.1 0.1)\", \"oklch(60% 0.15 50)\"), color() for wide-gamut (\"color(display-p3 1 0.5 0)\"), or CSS named colors (\"indigo\", \"rebeccapurple\").";
83
83
  readonly includeTypography: "Include typography setup in the generated theme. Set to false if you want to configure typography separately. Defaults to true.";
84
84
  readonly includeElevations: "Include elevation shadows in the generated theme. Set to false if you want to configure elevations separately. Defaults to true.";
85
- readonly includeSpacing: "Include spacing CSS custom properties (Web Components platform only). Defaults to true. Has no effect on Angular platform.";
85
+ readonly includeSpacing: "Include spacing CSS custom properties. Applies to Web Components, React, and Blazor. Has no effect on Angular. Defaults to true.";
86
86
  readonly colorDefinition: "Color definition object with mode selection:\n• mode: \"shades\" + baseColor: Auto-generates all shades from one color\n• mode: \"explicit\" + shades: Manually specify all 14 shades required: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400, A700\nIMPORTANT: All shades must be MONOCHROMATIC (same hue). Shades are lighter/darker versions of ONE color, not different colors.";
87
87
  readonly grayDefinition: "Gray color definition object with mode selection:\n• mode: \"shades\" + baseColor: Auto-generates all shades from one color\n• mode: \"explicit\" + shades: Manually specify all 10 shades required: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900\nImportant: Gray progression is INVERTED for dark themes (50=darkest, 900=lightest).";
88
88
  readonly baseColor: "Base color for automatic shade generation using shades() function. Choose a mid-luminance color (0.1-0.4) for best results. Valid CSS color formats: hex (\"#3F51B5\", \"#3F51B5AA\"), rgb/rgba (\"rgb(63, 81, 181)\", \"rgb(63 81 181 / 0.5)\"), hsl/hsla (\"hsl(231, 48%, 48%)\", \"hsl(231 48% 48% / 0.5)\"), hwb (\"hwb(231 20% 30%)\"), lab/lch (\"lab(50% 40 59)\", \"lch(50% 80 30)\"), oklab/oklch (\"oklab(59% 0.1 0.1)\", \"oklch(60% 0.15 50)\"), color() for wide-gamut (\"color(display-p3 1 0.5 0)\"), or CSS named colors (\"indigo\", \"rebeccapurple\").";
@@ -39,6 +39,10 @@ var TOOL_DESCRIPTIONS = {
39
39
  <use_case>
40
40
  Use this tool FIRST before generating any theme code to ensure platform-optimized output.
41
41
  The detected platform determines the correct Sass module paths and syntax.
42
+ Output format ("sass" vs "css") is a separate concern — see the output parameter on each
43
+ generation tool. For non-Angular platforms, prefer "css" unless the project has a confirmed
44
+ Sass pipeline; use your own file-reading tools or ask the user to confirm before choosing
45
+ output: "sass".
42
46
  </use_case>
43
47
 
44
48
  <detection_signals>
@@ -461,7 +465,7 @@ var TOOL_DESCRIPTIONS = {
461
465
  2. Creates color palette using palette() function
462
466
  3. Sets up typography with specified font family (if includeTypography: true)
463
467
  4. Configures elevations based on design system (if includeElevations: true)
464
- 5. Configures spacing utilities for Web Components (if includeSpacing: true)
468
+ 5. Configures spacing utilities for Web Components, React, and Blazor (if includeSpacing: true)
465
469
  6. Applies the theme using the theme() mixin
466
470
  7. Returns luminance warnings if any colors may produce poor shades
467
471
  </workflow>
@@ -1032,7 +1036,13 @@ var PARAM_DESCRIPTIONS = {
1032
1036
  variant: FRAGMENTS.VARIANT,
1033
1037
  designSystem: FRAGMENTS.DESIGN_SYSTEM,
1034
1038
  name: `Custom variable name (without $ prefix). If omitted, auto-generates based on tool and variant (e.g., "custom-light", "my-theme").`,
1035
- output: `Output format: "sass" generates Sass code using igniteui-theming library functions. "css" generates CSS custom properties (variables) directly - useful for vanilla CSS projects or when you don't want Sass compilation. Defaults to tool-specific output ("sass" for theme generators, "css" for layout setters).`,
1039
+ output: `Output format for the generated code.
1040
+
1041
+ "sass" — Returns Sass source using igniteui-theming functions and mixins. Requires a Sass pipeline in the consuming project. Prefer for Angular (Angular CLI handles Sass compilation automatically).
1042
+
1043
+ "css" — The MCP server compiles the Sass internally and returns ready-to-use CSS custom properties. No local Sass toolchain needed. Prefer for Web Components, React, and Blazor unless the project has a confirmed Sass setup (e.g. .scss files and a sass build step are present). When in doubt, use "css" or ask the user.
1044
+
1045
+ Layout tools (set_size, set_spacing, set_roundness) default to "css". Generation tools (create_palette, create_theme, etc.) default to "sass" for Angular and "css" for all other platforms.`,
1036
1046
  packageJsonPath: `Path to package.json file, relative to current working directory. Defaults to "./package.json".`,
1037
1047
  primary: `Primary brand color - used for main actions, active states, and emphasis. ${FRAGMENTS.COLOR_FORMAT}`,
1038
1048
  secondary: `Secondary/accent color - used for FABs, selection controls, highlights. ${FRAGMENTS.COLOR_FORMAT}`,
@@ -1050,7 +1060,7 @@ var PARAM_DESCRIPTIONS = {
1050
1060
  surfaceColor: `Surface/background color for the theme. Use light colors (#FAFAFA) for "light" variant, dark colors (#121212) for "dark" variant. ${FRAGMENTS.COLOR_FORMAT}`,
1051
1061
  includeTypography: "Include typography setup in the generated theme. Set to false if you want to configure typography separately. Defaults to true.",
1052
1062
  includeElevations: "Include elevation shadows in the generated theme. Set to false if you want to configure elevations separately. Defaults to true.",
1053
- includeSpacing: "Include spacing CSS custom properties (Web Components platform only). Defaults to true. Has no effect on Angular platform.",
1063
+ includeSpacing: "Include spacing CSS custom properties. Applies to Web Components, React, and Blazor. Has no effect on Angular. Defaults to true.",
1054
1064
  colorDefinition: `Color definition object with mode selection:
1055
1065
  • mode: "shades" + baseColor: Auto-generates all shades from one color
1056
1066
  • mode: "explicit" + shades: Manually specify all ${FRAGMENTS.CHROMATIC_SHADES}
@@ -24,7 +24,7 @@ function getComposedTokenWarning(componentName, tokenNames) {
24
24
  ⚠️ **Composed component notice:** \`${componentName}\` only needs the primary tokens (${[...primaryNames].map((t) => `\`${t}\``).join(", ")}). The other ${nonPrimaryTokens.length} token(s) override auto-derived values, which may cause visual inconsistencies. If the user did not explicitly request these tokens, consider re-generating with only the primary tokens.`;
25
25
  }
26
26
  async function handleCreateComponentTheme(params) {
27
- const { platform, component, tokens, selector, name, output = "sass", designSystem = "material", variant = "light" } = params;
27
+ const { platform, component, tokens, selector, name, output = params.platform === "angular" ? "sass" : "css", designSystem = "material", variant = "light" } = params;
28
28
  const normalizedComponent = component.toLowerCase().trim();
29
29
  if (!platform) return {
30
30
  content: [{
@@ -11,7 +11,7 @@ import "../../validators/index.js";
11
11
  async function handleCreateCustomPalette(params) {
12
12
  const variant = params.variant ?? "light";
13
13
  const designSystem = params.designSystem ?? "material";
14
- const output = params.output ?? "sass";
14
+ const output = params.output ?? (params.platform === "angular" ? "sass" : "css");
15
15
  const preset = PALETTE_PRESETS[`${variant}-${designSystem}-palette`];
16
16
  let surfaceColorForGray;
17
17
  if (params.surface.mode === "shades") surfaceColorForGray = params.surface.baseColor;
@@ -1,7 +1,7 @@
1
1
  import { CreateElevationsParams } from '../schemas.js';
2
- export declare function handleCreateElevations(params: CreateElevationsParams): {
2
+ export declare function handleCreateElevations(params: CreateElevationsParams): Promise<{
3
3
  content: {
4
4
  type: "text";
5
5
  text: string;
6
6
  }[];
7
- };
7
+ }>;
@@ -1,11 +1,41 @@
1
1
  import { PLATFORM_METADATA } from "../../knowledge/platforms/index.js";
2
2
  import { SASS_USE_ASSEMBLY_NOTE } from "../../utils/sass.js";
3
3
  import { generateElevations } from "../../generators/sass.js";
4
+ import { formatCssOutput, generateElevationsCss } from "../../generators/css.js";
4
5
  //#region src/tools/handlers/elevations.ts
5
6
  /**
6
7
  * Handler for create_elevations tool.
7
8
  */
8
- function handleCreateElevations(params) {
9
+ async function handleCreateElevations(params) {
10
+ if ((params.output ?? (params.platform === "angular" ? "sass" : "css")) === "css") return handleCssOutput(params);
11
+ return handleSassOutput(params);
12
+ }
13
+ async function handleCssOutput(params) {
14
+ try {
15
+ const result = await generateElevationsCss({ designSystem: params.designSystem });
16
+ const formattedCss = formatCssOutput(result.css, result.description);
17
+ const responseParts = [result.description];
18
+ responseParts.push("");
19
+ responseParts.push("Output format: CSS custom properties");
20
+ responseParts.push("");
21
+ responseParts.push("```css");
22
+ responseParts.push(formattedCss.trimEnd());
23
+ responseParts.push("```");
24
+ return { content: [{
25
+ type: "text",
26
+ text: responseParts.join("\n")
27
+ }] };
28
+ } catch (error) {
29
+ return {
30
+ content: [{
31
+ type: "text",
32
+ text: `**Error generating CSS elevations**\n\n${error instanceof Error ? error.message : String(error)}`
33
+ }],
34
+ isError: true
35
+ };
36
+ }
37
+ }
38
+ function handleSassOutput(params) {
9
39
  const result = generateElevations({
10
40
  platform: params.platform,
11
41
  licensed: params.licensed,
@@ -10,7 +10,7 @@ import "../../validators/index.js";
10
10
  */
11
11
  async function handleCreatePalette(params) {
12
12
  const variant = params.variant ?? "light";
13
- const output = params.output ?? "sass";
13
+ const output = params.output ?? (params.platform === "angular" ? "sass" : "css");
14
14
  const validation = await validatePaletteColors({
15
15
  variant,
16
16
  surface: params.surface,
@@ -1,5 +1,6 @@
1
1
  import { SASS_USE_ASSEMBLY_NOTE } from "../../utils/sass.js";
2
2
  import { generateTheme } from "../../generators/sass.js";
3
+ import { formatCssOutput, generateThemeCss } from "../../generators/css.js";
3
4
  import { analyzeThemeColorsForPalette, formatPaletteSuitabilityWarnings, formatValidationResult, generatePaletteSuitabilityComments, generateWarningComments, validatePaletteColors } from "../../validators/palette.js";
4
5
  import "../../validators/index.js";
5
6
  //#region src/tools/handlers/theme.ts
@@ -7,8 +8,10 @@ import "../../validators/index.js";
7
8
  * Handler for create_theme tool.
8
9
  */
9
10
  async function handleCreateTheme(params) {
11
+ const variant = params.variant ?? "light";
12
+ const output = params.output ?? (params.platform === "angular" ? "sass" : "css");
10
13
  const validation = await validatePaletteColors({
11
- variant: params.variant ?? "light",
14
+ variant,
12
15
  surface: params.surfaceColor
13
16
  });
14
17
  const suitabilityAnalysis = await analyzeThemeColorsForPalette({
@@ -16,6 +19,65 @@ async function handleCreateTheme(params) {
16
19
  secondary: params.secondaryColor,
17
20
  surface: params.surfaceColor
18
21
  });
22
+ if (output === "css") return handleCssOutput(params, validation, suitabilityAnalysis);
23
+ return handleSassOutput(params, validation, suitabilityAnalysis);
24
+ }
25
+ async function handleCssOutput(params, validation, suitabilityAnalysis) {
26
+ try {
27
+ const result = await generateThemeCss({
28
+ platform: params.platform,
29
+ designSystem: params.designSystem,
30
+ variant: params.variant,
31
+ primaryColor: params.primaryColor,
32
+ secondaryColor: params.secondaryColor,
33
+ surfaceColor: params.surfaceColor,
34
+ fontFamily: params.fontFamily,
35
+ includeTypography: params.includeTypography,
36
+ includeElevations: params.includeElevations,
37
+ includeSpacing: params.includeSpacing,
38
+ name: params.name
39
+ });
40
+ const formattedCss = formatCssOutput(result.css, result.description);
41
+ const responseParts = [result.description];
42
+ responseParts.push("");
43
+ responseParts.push("Output format: CSS custom properties");
44
+ if (params.platform) {
45
+ const { PLATFORM_METADATA } = await import("../../knowledge/platforms/index.js");
46
+ responseParts.push("");
47
+ responseParts.push(`Platform: ${PLATFORM_METADATA[params.platform]?.name ?? params.platform}`);
48
+ }
49
+ if (result.angularCaveat) {
50
+ responseParts.push("");
51
+ responseParts.push("⚠️ Angular note: This CSS output contains only CSS custom properties (--ig-* variables). It does not include the component-scoped class styles generated by Angular's core() and theme() mixins. For full Angular theme output use output: \"sass\".");
52
+ }
53
+ const validationText = formatValidationResult(validation);
54
+ if (validationText) {
55
+ responseParts.push("");
56
+ responseParts.push(validationText);
57
+ }
58
+ if (!suitabilityAnalysis.allSuitable) {
59
+ responseParts.push("");
60
+ responseParts.push(formatPaletteSuitabilityWarnings(suitabilityAnalysis));
61
+ }
62
+ responseParts.push("");
63
+ responseParts.push("```css");
64
+ responseParts.push(formattedCss.trimEnd());
65
+ responseParts.push("```");
66
+ return { content: [{
67
+ type: "text",
68
+ text: responseParts.join("\n")
69
+ }] };
70
+ } catch (error) {
71
+ return {
72
+ content: [{
73
+ type: "text",
74
+ text: `**Error generating CSS theme**\n\n${error instanceof Error ? error.message : String(error)}`
75
+ }],
76
+ isError: true
77
+ };
78
+ }
79
+ }
80
+ async function handleSassOutput(params, validation, suitabilityAnalysis) {
19
81
  const result = generateTheme({
20
82
  platform: params.platform,
21
83
  licensed: params.licensed,
@@ -1,7 +1,7 @@
1
1
  import { CreateTypographyParams } from '../schemas.js';
2
- export declare function handleCreateTypography(params: CreateTypographyParams): {
2
+ export declare function handleCreateTypography(params: CreateTypographyParams): Promise<{
3
3
  content: {
4
4
  type: "text";
5
5
  text: string;
6
6
  }[];
7
- };
7
+ }>;