igniteui-cli 15.1.0 → 15.2.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.
- package/lib/PromptSession.d.ts +1 -1
- package/lib/PromptSession.js +2 -2
- package/lib/commands/ai-config.d.ts +3 -5
- package/lib/commands/ai-config.js +68 -23
- package/lib/commands/new.js +1 -1
- package/package.json +4 -4
- package/templates/blazor/igb/index.d.ts +1 -0
- package/templates/blazor/igb/index.js +12 -0
- package/templates/blazor/igb/projects/ai-config/files/AGENTS.md +65 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/AGENTS.md +65 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/README.md +61 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/SKILL.md +118 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/charts.md +302 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/data-display.md +350 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/feedback.md +178 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/form-controls.md +365 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout-manager.md +180 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout.md +322 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/mcp-setup.md +78 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/setup.md +214 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/SKILL.md +284 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/references/component-mapping.md +281 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/references/gotchas.md +503 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/SKILL.md +188 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/data-operations.md +264 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/editing.md +297 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/features.md +447 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/mcp-setup.md +78 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/paging-remote.md +299 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/sizing.md +284 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/state.md +160 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/structure.md +497 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/types.md +553 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/SKILL.md +259 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/references/common-patterns.md +276 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/references/mcp-setup.md +81 -0
- package/templates/blazor/igb/projects/ai-config/index.d.ts +22 -0
- package/templates/blazor/igb/projects/ai-config/index.js +62 -0
- package/templates/blazor/index.d.ts +3 -0
- package/templates/blazor/index.js +11 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: igniteui-blazor-theming
|
|
3
|
+
description: "Covers theming and visual customization for Ignite UI for Blazor: choosing and switching built-in themes (Bootstrap, Material, Fluent, Indigo - light and dark variants), customizing component appearance with CSS custom properties (design tokens), using the igniteui-theming MCP server to generate component themes and palettes, applying custom palettes, setting roundness/spacing/sizing tokens globally, dark mode switching, scoped component theming, and CSS parts. Use when users ask about changing the look and feel of Ignite UI Blazor components, applying a color scheme, generating CSS variables, using CSS parts, or customizing design tokens. Do NOT use for grid data features or component configuration - use igniteui-blazor-grids or igniteui-blazor-components instead."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Ignite UI for Blazor - Theming and Styling
|
|
8
|
+
|
|
9
|
+
## Description
|
|
10
|
+
|
|
11
|
+
This skill teaches AI agents how to theme Ignite UI for Blazor applications using built-in CSS theme files, CSS custom properties, CSS shadow parts, and the **Ignite UI Theming MCP server**. It covers theme switching, palette generation, component-level design tokens, global layout tokens, and scoped CSS customization.
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
- A Blazor project using Ignite UI for Blazor components
|
|
16
|
+
- A theme CSS file linked in the host page (see [`references/common-patterns.md`](./references/common-patterns.md))
|
|
17
|
+
- The **Ignite UI Theming MCP server** (`igniteui-theming`) available as a tool provider
|
|
18
|
+
|
|
19
|
+
> **AGENT INSTRUCTION - MCP Server Setup (REQUIRED)**
|
|
20
|
+
>
|
|
21
|
+
> Before using any theming tools, you MUST verify the MCP server is available
|
|
22
|
+
> by calling any lightweight theming MCP tool.
|
|
23
|
+
> This skill is already scoped to Ignite UI for Blazor, so use `platform: "blazor"`
|
|
24
|
+
> in theming tool calls. If the theming tool is not available or the call fails,
|
|
25
|
+
> you MUST automatically configure it by following the setup process steps described below.
|
|
26
|
+
>
|
|
27
|
+
> After writing the file, inform the user that the MCP server has been
|
|
28
|
+
> configured and they may need to reload the editor for the tools to activate.
|
|
29
|
+
> Start the MCP server and wait for that MCP server to start before continuing the theming related work.
|
|
30
|
+
> Do NOT skip this step or ask the user to do it manually.
|
|
31
|
+
|
|
32
|
+
## Setting Up the Theming MCP Server
|
|
33
|
+
|
|
34
|
+
> **Full setup instructions for VS Code, Cursor, Claude Desktop, and JetBrains IDEs are in [`references/mcp-setup.md`](./references/mcp-setup.md).** Read that file for editor-specific configuration steps and verification.
|
|
35
|
+
|
|
36
|
+
## Theming Architecture
|
|
37
|
+
|
|
38
|
+
| Layer | Purpose |
|
|
39
|
+
|---|---|
|
|
40
|
+
| Built-in theme CSS | Baseline Bootstrap, Material, Fluent, or Indigo styling in light/dark variants |
|
|
41
|
+
| Palette tokens | Global color CSS variables used across components |
|
|
42
|
+
| Component design tokens | Component-scoped CSS custom properties generated or discovered with MCP |
|
|
43
|
+
| CSS shadow parts | Fine-grained internal element styling only when the component doc lists supported parts |
|
|
44
|
+
| Layout tokens | Global roundness, spacing, and size controls generated by MCP tools |
|
|
45
|
+
|
|
46
|
+
Ignite UI for Blazor theming in this skill is CSS-first. Agents should generate or edit CSS custom properties and selectors for normal app styling.
|
|
47
|
+
|
|
48
|
+
## Built-In Themes
|
|
49
|
+
|
|
50
|
+
Use built-in theme CSS files for the baseline visual system. Supported design systems are Bootstrap, Material, Fluent, and Indigo, with light and dark variants.
|
|
51
|
+
|
|
52
|
+
Confirm exact file paths in [`references/common-patterns.md`](./references/common-patterns.md) before writing host-page markup. Only one built-in theme CSS file should be active at a time.
|
|
53
|
+
|
|
54
|
+
## Color Palettes
|
|
55
|
+
|
|
56
|
+
Use `create_palette(platform: "blazor", output: "css", ...)` for a generated palette from seed colors. Use `create_custom_palette(platform: "blazor", output: "css", ...)` only when the user needs explicit control over individual shade values.
|
|
57
|
+
|
|
58
|
+
Palette CSS belongs in `:root` and must be loaded after the Ignite UI built-in theme CSS.
|
|
59
|
+
|
|
60
|
+
For simple palette references, use `get_color` instead of writing color variable names from memory:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
get_color(color: "primary", variant: "600")
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Use `contrast: true` when you need the matching text color token.
|
|
67
|
+
|
|
68
|
+
Raw color values are acceptable in the initial palette seed call. After the palette exists, component themes and custom CSS should use palette CSS custom properties wherever the desired color belongs to the theme.
|
|
69
|
+
|
|
70
|
+
Palette shades: chromatic shades use `50` as the lightest shade and `900` as the darkest shade. Do not invert chromatic colors for dark themes; only gray is inverted for dark variants.
|
|
71
|
+
|
|
72
|
+
Surface color must match the variant: use a light surface for `variant: "light"` and a dark surface for `variant: "dark"`.
|
|
73
|
+
|
|
74
|
+
## Component-Level Theming
|
|
75
|
+
|
|
76
|
+
For component styling, first call `get_component_design_tokens(component: "...")`, then call `create_component_theme(platform: "blazor", component: "...", tokens: {...}, output: "css")` or write CSS using the returned token names. Do not use `overrides`; the MCP argument is `tokens`.
|
|
77
|
+
|
|
78
|
+
For components with variants, query the exact variant whenever possible. For example, use `contained-button`, `flat-button`, `outlined-button`, or `fab-button` instead of generic `button` before generating a component theme.
|
|
79
|
+
|
|
80
|
+
Use palette token references such as `var(--ig-primary-500)` and `var(--ig-primary-500-contrast)` after a palette has been established. Do not pass raw hex/RGB/HSL values to component theme tokens unless the value is intentionally outside the theme palette.
|
|
81
|
+
|
|
82
|
+
For CSS parts, call the component's Blazor `get_doc` entry first. Do not say a component exposes CSS parts unless the Blazor doc confirms the exact part names.
|
|
83
|
+
|
|
84
|
+
### Discovering Available Tokens
|
|
85
|
+
|
|
86
|
+
Each component has its own set of design tokens. Before theming a component, call `get_component_design_tokens` and use only token names returned by the tool.
|
|
87
|
+
|
|
88
|
+
### Compound Components
|
|
89
|
+
|
|
90
|
+
Some components are compound and may involve internally themed child components. When `get_component_design_tokens` returns compound guidance, follow the checklist from the tool response.
|
|
91
|
+
|
|
92
|
+
For standard compound components, generate the related themes listed by the tool and scope them under the parent component selector. For composed compound components, use only the primary parent tokens unless the user explicitly requests a specific refinement token.
|
|
93
|
+
|
|
94
|
+
## Layout Controls
|
|
95
|
+
|
|
96
|
+
Use MCP layout tools for global or scoped layout changes:
|
|
97
|
+
|
|
98
|
+
| Goal | MCP tool | Required value shape |
|
|
99
|
+
|---|---|---|
|
|
100
|
+
| Roundness | `set_roundness` | `radiusFactor: 0..1` |
|
|
101
|
+
| Spacing | `set_spacing` | `spacing: number` plus optional `inline` / `block` |
|
|
102
|
+
| Size | `set_size` | `size: "small" | "medium" | "large"` |
|
|
103
|
+
|
|
104
|
+
Do not use legacy size names such as `compact`, `cosy`, or `comfortable` for Blazor theming tools.
|
|
105
|
+
|
|
106
|
+
## Using the Theming MCP Server
|
|
107
|
+
|
|
108
|
+
The Ignite UI Theming MCP server provides code generation and reference tools for Blazor-ready CSS custom properties. Agents can see tool schemas directly, so this section only records the Ignite UI for Blazor theming workflow and product-specific constraints.
|
|
109
|
+
|
|
110
|
+
> **IMPORTANT - File Safety Rule**: When generating or updating theme code, **never overwrite existing style files directly**. Instead, propose the changes as an update and let the user review and approve before writing to disk. If an `app.css`, `site.css`, `.razor.css`, or other target style 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.
|
|
111
|
+
|
|
112
|
+
Always follow this workflow:
|
|
113
|
+
|
|
114
|
+
### Step 1 - Verify Blazor Theming Context
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
Tool: read_resource
|
|
118
|
+
Params: { uri: "theming://platforms/blazor" }
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Use this as the lightweight availability check and platform reference for Blazor theming tasks.
|
|
122
|
+
|
|
123
|
+
### Step 2 - Generate a Palette
|
|
124
|
+
|
|
125
|
+
> **Note:** For Blazor (CSS-first, no Sass pipeline), use `create_palette` with `output: "css"` to get CSS custom properties directly. Do NOT use `create_theme` for Blazor — it always outputs Sass which requires a compilation step not present in standard Blazor projects. The `create_palette` param names are `primary`/`secondary`/`surface` (not `primaryColor`/`secondaryColor`/`surfaceColor` — those belong to `create_theme`).
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
Tool: create_palette
|
|
129
|
+
Params: {
|
|
130
|
+
platform: "blazor",
|
|
131
|
+
output: "css",
|
|
132
|
+
primary: "#3f51b5",
|
|
133
|
+
secondary: "#e91e63",
|
|
134
|
+
surface: "#ffffff",
|
|
135
|
+
variant: "light"
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
For dark themes, use a dark surface color and `variant: "dark"`. Read `theming://guidance/colors/rules` first when surface or gray color choices are unclear.
|
|
140
|
+
|
|
141
|
+
### Step 3 - Customize Individual Components
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
Tool: get_component_design_tokens
|
|
145
|
+
Params: { component: "contained-button" }
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Then generate CSS using only valid token names returned by the tool:
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
Tool: create_component_theme
|
|
152
|
+
Params: {
|
|
153
|
+
platform: "blazor",
|
|
154
|
+
output: "css",
|
|
155
|
+
component: "contained-button",
|
|
156
|
+
tokens: {
|
|
157
|
+
"background": "var(--ig-primary-500)",
|
|
158
|
+
"foreground": "var(--ig-primary-500-contrast)"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Use `tokens`, not `overrides`. If the token discovery response distinguishes primary tokens from refinement tokens, use only the primary tokens unless the user explicitly requested the refined state or subpart.
|
|
164
|
+
|
|
165
|
+
### Step 4 - Adjust Global Layout Tokens
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
Tool: set_roundness
|
|
169
|
+
Params: { platform: "blazor", output: "css", radiusFactor: 0.5 }
|
|
170
|
+
|
|
171
|
+
Tool: set_spacing
|
|
172
|
+
Params: { platform: "blazor", output: "css", spacing: 1.25 }
|
|
173
|
+
|
|
174
|
+
Tool: set_size
|
|
175
|
+
Params: { platform: "blazor", output: "css", size: "small" }
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Step 5 - Apply Generated CSS
|
|
179
|
+
|
|
180
|
+
Place generated CSS in an app stylesheet loaded after the Ignite UI theme CSS, such as `wwwroot/css/app.css`.
|
|
181
|
+
|
|
182
|
+
```html
|
|
183
|
+
<link href="_content/IgniteUI.Blazor/themes/light/bootstrap.css" rel="stylesheet" />
|
|
184
|
+
<link href="css/app.css" rel="stylesheet" />
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Palette and global layout CSS normally go in `:root`. Component theme CSS goes on the generated `igc-*` selector or under a scoped wrapper selector.
|
|
188
|
+
|
|
189
|
+
In `.razor.css` isolation files, prefix `igc-*` selectors so Blazor CSS isolation does not block the override.
|
|
190
|
+
|
|
191
|
+
### Loading Reference Data
|
|
192
|
+
|
|
193
|
+
Use `read_resource` with these URIs for preset values and documentation:
|
|
194
|
+
|
|
195
|
+
| URI | Content |
|
|
196
|
+
|---|---|
|
|
197
|
+
| `theming://platforms/blazor` | Blazor platform specifics |
|
|
198
|
+
| `theming://presets/palettes` | Preset palette colors |
|
|
199
|
+
| `theming://guidance/colors/usage` | Which shades to use for which purpose |
|
|
200
|
+
| `theming://guidance/colors/roles` | Semantic color roles |
|
|
201
|
+
| `theming://guidance/colors/rules` | Light/dark theme color rules |
|
|
202
|
+
|
|
203
|
+
## Mandatory Agent Protocol
|
|
204
|
+
|
|
205
|
+
> **DO NOT write CSS variable names, token names, or palette colors from memory.**
|
|
206
|
+
> Design token names and values are version-specific and theme-specific. Anything generated without reading the reference files or querying the MCP theming server will produce incorrect CSS.
|
|
207
|
+
|
|
208
|
+
You are required to complete all of the following steps before producing any theming-related code or answer:
|
|
209
|
+
|
|
210
|
+
**Step 1 - Identify the theming task.**
|
|
211
|
+
Map the user's request to one or more rows in the Task to Reference File table below.
|
|
212
|
+
|
|
213
|
+
**Step 2 - Use the theming MCP tools for version-specific values.**
|
|
214
|
+
For any task involving design token lookup, palette generation, component theme CSS, or global layout tokens, call the relevant Ignite UI Theming MCP tool. Do not infer token names, selector names, or palette variables from memory.
|
|
215
|
+
|
|
216
|
+
**Step 3 - Read the relevant reference files in parallel.**
|
|
217
|
+
Call `read_file` on all identified reference files in a single parallel batch.
|
|
218
|
+
|
|
219
|
+
**Step 4 - Only then produce output.**
|
|
220
|
+
Base CSS and instructions on what the MCP tools return and what the reference files say.
|
|
221
|
+
|
|
222
|
+
### Task to Reference File
|
|
223
|
+
|
|
224
|
+
| Task | Reference file to read |
|
|
225
|
+
|---|---|
|
|
226
|
+
| Switching themes (light/dark/Bootstrap/Material/Fluent/Indigo), adding the CSS link, dark mode toggle, scoped theming | [`references/common-patterns.md`](./references/common-patterns.md) |
|
|
227
|
+
| Setting up the MCP theming server in VS Code, Cursor, Claude Desktop, or JetBrains IDEs | [`references/mcp-setup.md`](./references/mcp-setup.md) |
|
|
228
|
+
|
|
229
|
+
## Key Blazor Theming Notes
|
|
230
|
+
|
|
231
|
+
> **AGENT INSTRUCTION - CSS customization**
|
|
232
|
+
>
|
|
233
|
+
> For normal Ignite UI for Blazor app styling, generate CSS custom properties and selectors.
|
|
234
|
+
|
|
235
|
+
> **AGENT INSTRUCTION - CSS parts**
|
|
236
|
+
>
|
|
237
|
+
> Some Ignite UI Blazor components expose CSS shadow parts via `::part()`. Use `get_doc` for the component to confirm whether parts are available and to get the exact part names. Use `get_component_design_tokens` to get token names; do not infer token names or part names from Angular, React, or Web Components examples.
|
|
238
|
+
|
|
239
|
+
> **AGENT INSTRUCTION - Theming MCP server platform**
|
|
240
|
+
>
|
|
241
|
+
> This skill already establishes the platform. When calling Ignite UI Theming MCP tools that accept a platform, always pass `platform: "blazor"`.
|
|
242
|
+
|
|
243
|
+
## Key Rules
|
|
244
|
+
|
|
245
|
+
1. **Use `platform: "blazor"` and `output: "css"`** on theming tools that accept those parameters
|
|
246
|
+
2. **Always call `get_component_design_tokens` before component CSS overrides**; token names are not guessable from component names
|
|
247
|
+
3. **Use exact component variants** for variant components, such as `contained-button`, `flat-button`, `outlined-button`, and `fab-button`
|
|
248
|
+
4. **Use `tokens` with `create_component_theme`**; do not use an `overrides` object
|
|
249
|
+
5. **Use palette tokens after palette generation**; raw colors belong in palette seed inputs, not downstream component theme values
|
|
250
|
+
6. **Place generated CSS after the built-in Ignite UI theme CSS** so overrides win in the cascade
|
|
251
|
+
7. **Use `igc-*` selectors in CSS**, not Razor component names such as `IgbButton`
|
|
252
|
+
8. **Use `::part()` only after confirming part names with Blazor docs**, and prefer design tokens when a token exists
|
|
253
|
+
9. **Surface color must match the variant**; use a light surface for `light` and a dark surface for `dark`
|
|
254
|
+
10. **Only one built-in theme CSS file should be active at a time** to avoid conflicting variables and component styles
|
|
255
|
+
|
|
256
|
+
## Related Skills
|
|
257
|
+
|
|
258
|
+
- [`igniteui-blazor-components`](../igniteui-blazor-components/SKILL.md) - All non-grid UI components
|
|
259
|
+
- [`igniteui-blazor-grids`](../igniteui-blazor-grids/SKILL.md) - Data Grids
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
# Common Theming Patterns
|
|
2
|
+
|
|
3
|
+
> **Part of the [`igniteui-blazor-theming`](../SKILL.md) skill hub.**
|
|
4
|
+
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
- [Built-in Themes](#built-in-themes)
|
|
8
|
+
- [Switching Theme at Build Time](#switching-theme-at-build-time)
|
|
9
|
+
- [Dark Mode Toggle at Runtime](#dark-mode-toggle-at-runtime)
|
|
10
|
+
- [CSS Custom Properties (Design Tokens)](#css-custom-properties-design-tokens)
|
|
11
|
+
- [Scoped Component Theming](#scoped-component-theming)
|
|
12
|
+
- [CSS Parts](#css-parts)
|
|
13
|
+
- [Global Design Tokens](#global-design-tokens)
|
|
14
|
+
- [Key Rules](#key-rules)
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Built-in Themes
|
|
19
|
+
|
|
20
|
+
Ignite UI for Blazor ships 8 built-in themes (4 families × 2 modes):
|
|
21
|
+
|
|
22
|
+
| Theme | Light CSS path | Dark CSS path |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| Bootstrap | `themes/light/bootstrap.css` | `themes/dark/bootstrap.css` |
|
|
25
|
+
| Material | `themes/light/material.css` | `themes/dark/material.css` |
|
|
26
|
+
| Fluent | `themes/light/fluent.css` | `themes/dark/fluent.css` |
|
|
27
|
+
| Indigo | `themes/light/indigo.css` | `themes/dark/indigo.css` |
|
|
28
|
+
|
|
29
|
+
All paths are relative to `_content/IgniteUI.Blazor/`.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Switching Theme at Build Time
|
|
34
|
+
|
|
35
|
+
Add a single `<link>` tag in your host page:
|
|
36
|
+
|
|
37
|
+
### Blazor Server / Web App - `Components/App.razor` or `Pages/_Host.cshtml`
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<link href="_content/IgniteUI.Blazor/themes/light/bootstrap.css" rel="stylesheet" />
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Blazor WASM - `wwwroot/index.html`
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<link href="_content/IgniteUI.Blazor/themes/light/material.css" rel="stylesheet" />
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### .NET 9+ Web App - use `Assets` collection
|
|
50
|
+
|
|
51
|
+
```razor
|
|
52
|
+
<link rel="stylesheet" href="@Assets["_content/IgniteUI.Blazor/themes/light/fluent.css"]" />
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Replace the file name to switch the entire application theme. Only **one** theme CSS file should be loaded at a time.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Dark Mode Toggle at Runtime
|
|
60
|
+
|
|
61
|
+
Switch themes dynamically by updating the `href` attribute of the theme `<link>` tag via JavaScript interop or by using a CSS class on the `<body>`:
|
|
62
|
+
|
|
63
|
+
### Approach 1 - Replace the stylesheet href (JS Interop)
|
|
64
|
+
|
|
65
|
+
```razor
|
|
66
|
+
@inject IJSRuntime JS
|
|
67
|
+
|
|
68
|
+
<IgbButton @onclick="ToggleDark">Toggle Dark Mode</IgbButton>
|
|
69
|
+
|
|
70
|
+
@code {
|
|
71
|
+
bool IsDark = false;
|
|
72
|
+
|
|
73
|
+
async Task ToggleDark()
|
|
74
|
+
{
|
|
75
|
+
IsDark = !IsDark;
|
|
76
|
+
var theme = IsDark ? "dark/bootstrap" : "light/bootstrap";
|
|
77
|
+
await JS.InvokeVoidAsync("setTheme", $"_content/IgniteUI.Blazor/themes/{theme}.css");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
```html
|
|
83
|
+
<!-- wwwroot/index.html or App.razor -->
|
|
84
|
+
<link id="igTheme" href="_content/IgniteUI.Blazor/themes/light/bootstrap.css" rel="stylesheet" />
|
|
85
|
+
|
|
86
|
+
<script>
|
|
87
|
+
window.setTheme = function (href) {
|
|
88
|
+
document.getElementById('igTheme').setAttribute('href', href);
|
|
89
|
+
};
|
|
90
|
+
</script>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Approach 2 - Preload both themes and toggle link disabled states
|
|
94
|
+
|
|
95
|
+
```html
|
|
96
|
+
<link id="igLightTheme" href="_content/IgniteUI.Blazor/themes/light/bootstrap.css" rel="stylesheet" />
|
|
97
|
+
<link id="igDarkTheme" href="_content/IgniteUI.Blazor/themes/dark/bootstrap.css" rel="stylesheet" disabled />
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
window.toggleDarkMode = function (isDark) {
|
|
102
|
+
document.getElementById('igLightTheme').disabled = isDark;
|
|
103
|
+
document.getElementById('igDarkTheme').disabled = !isDark;
|
|
104
|
+
};
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## CSS Custom Properties (Design Tokens)
|
|
110
|
+
|
|
111
|
+
All visual attributes of Ignite UI components (colors, borders, shadows, fonts) are exposed as CSS custom properties. You override them by declaring the property in a CSS rule that matches the component's scope. Design tokens are the **primary** theming approach - prefer them over `::part()` selectors.
|
|
112
|
+
|
|
113
|
+
**Workflow:**
|
|
114
|
+
|
|
115
|
+
1. Call `get_component_design_tokens` to get all available tokens for a component.
|
|
116
|
+
2. Pick the tokens you want to change.
|
|
117
|
+
3. Write a CSS rule that overrides those tokens.
|
|
118
|
+
|
|
119
|
+
**File context matters:**
|
|
120
|
+
|
|
121
|
+
- **Global CSS file** (`app.css`) - write `igc-<tag> { --ig-<component>-<token>: value; }` directly.
|
|
122
|
+
- **`.razor.css` isolation file** - add `::deep` before the `igc-<tag>` selector.
|
|
123
|
+
|
|
124
|
+
```css
|
|
125
|
+
/* app.css - global, no ::deep needed */
|
|
126
|
+
:root {
|
|
127
|
+
--ig-primary-500: #7b2fff;
|
|
128
|
+
--ig-primary-600: #6200ee;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
igc-chip {
|
|
132
|
+
--ig-chip-background: var(--ig-primary-500);
|
|
133
|
+
--ig-chip-text-color: var(--ig-primary-500-contrast);
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
```css
|
|
138
|
+
/* MyView.razor.css - isolation file, ::deep required */
|
|
139
|
+
::deep igc-chip {
|
|
140
|
+
--ig-chip-background: var(--ig-primary-500);
|
|
141
|
+
--ig-chip-text-color: var(--ig-primary-500-contrast);
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
> **AGENT INSTRUCTION:** Always call `get_component_design_tokens(component: "<component-or-variant>")` before styling a component. For variant-based components such as buttons, query the exact variant such as `contained-button` or `flat-button`. Do NOT guess token names from memory.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Scoped Component Theming
|
|
150
|
+
|
|
151
|
+
Apply a custom theme to a specific component instance (without affecting all components):
|
|
152
|
+
|
|
153
|
+
```razor
|
|
154
|
+
<div class="my-custom-button">
|
|
155
|
+
<IgbButton>Custom Style</IgbButton>
|
|
156
|
+
</div>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
```css
|
|
160
|
+
/* Scoped token override in your app's CSS (global file, no ::deep) */
|
|
161
|
+
.my-custom-button igc-button {
|
|
162
|
+
--ig-primary-500: #ff5722;
|
|
163
|
+
--ig-primary-600: #e64a19;
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
When the scoped override is inside a `.razor.css` isolation file, add `::deep`:
|
|
168
|
+
|
|
169
|
+
```css
|
|
170
|
+
/* MyComponent.razor.css - isolation file */
|
|
171
|
+
::deep .my-custom-button igc-button {
|
|
172
|
+
--ig-primary-500: #ff5722;
|
|
173
|
+
--ig-primary-600: #e64a19;
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Use `::part()` within a scoped selector only for properties not covered by tokens - verify via `get_component_design_tokens` first:
|
|
178
|
+
|
|
179
|
+
```css
|
|
180
|
+
/* Global CSS */
|
|
181
|
+
.my-custom-button igc-button::part(base) {
|
|
182
|
+
border-radius: 20px;
|
|
183
|
+
font-weight: 700;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Isolation file */
|
|
187
|
+
::deep .my-custom-button igc-button::part(base) {
|
|
188
|
+
border-radius: 20px;
|
|
189
|
+
font-weight: 700;
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## CSS Parts
|
|
196
|
+
|
|
197
|
+
Some Ignite UI Blazor components expose shadow DOM parts via `::part()`. Use these for styling only after the Blazor component documentation confirms the exact part names. Prefer design token CSS custom properties (via `get_component_design_tokens` / `create_component_theme`) over `::part()` - tokens are the primary theming layer. Only reach for `::part()` when the property you need is not covered by any design token.
|
|
198
|
+
|
|
199
|
+
**`::part()` is not a replacement for design tokens.** Setting a design token (e.g., `--ig-chip-background`) is different from using `::part(base) { background: ... }`. Use the token approach when a token exists; use `::part()` for properties the token system does not expose.
|
|
200
|
+
|
|
201
|
+
**Workflow:**
|
|
202
|
+
|
|
203
|
+
1. Call `get_component_design_tokens` to check whether the desired property has a token.
|
|
204
|
+
2. If a token exists, set it via `igc-<tag> { --ig-<component>-<token>: value; }` - no `::part()` needed.
|
|
205
|
+
3. If no token covers it, call `get_doc` to see the component's CSS parts list, then use `igc-<component-tag>::part(<part-name>)`.
|
|
206
|
+
|
|
207
|
+
**File context:**
|
|
208
|
+
|
|
209
|
+
- **Global CSS file** (`app.css`): use `igc-<tag>::part(<name>) { ... }` directly.
|
|
210
|
+
- **`.razor.css` isolation file**: prefix with `::deep` → `::deep igc-<tag>::part(<name>) { ... }`.
|
|
211
|
+
|
|
212
|
+
Example - styling the dialog footer area (global CSS):
|
|
213
|
+
|
|
214
|
+
```css
|
|
215
|
+
/* app.css - global, no ::deep needed */
|
|
216
|
+
igc-dialog::part(footer) {
|
|
217
|
+
background-color: #f5f5f5;
|
|
218
|
+
border-top: 1px solid #e0e0e0;
|
|
219
|
+
padding: 12px 16px;
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Same override in a `.razor.css` isolation file:
|
|
224
|
+
|
|
225
|
+
```css
|
|
226
|
+
/* MyView.razor.css - isolation file, ::deep required */
|
|
227
|
+
::deep igc-dialog::part(footer) {
|
|
228
|
+
background-color: #f5f5f5;
|
|
229
|
+
border-top: 1px solid #e0e0e0;
|
|
230
|
+
padding: 12px 16px;
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
> **AGENT INSTRUCTION:** Blazor renders Ignite UI components as web components with `igc-` tag names. The CSS selector uses the web component tag name (e.g., `igc-button`, `igc-dialog`) not the Razor component name (`IgbButton`). `::deep` is a Blazor CSS isolation combinator - it is only needed in `.razor.css` files, not in global stylesheets.
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Global Design Tokens
|
|
239
|
+
|
|
240
|
+
Use the MCP theming tools to generate CSS for global design tokens:
|
|
241
|
+
|
|
242
|
+
### Roundness (border-radius)
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
set_roundness(platform: "blazor", output: "css", radiusFactor: 0.5)
|
|
246
|
+
# Returns CSS custom properties to add to :root
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
`radiusFactor` is a value from 0 (square) to 1 (maximum roundness).
|
|
250
|
+
|
|
251
|
+
### Spacing
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
set_spacing(platform: "blazor", output: "css", spacing: 1.25)
|
|
255
|
+
# Returns spacing CSS custom properties to add to :root
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Size
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
set_size(platform: "blazor", output: "css", size: "small")
|
|
262
|
+
# Returns size CSS custom properties; values: "small" | "medium" | "large"
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Add the returned CSS to your global `app.css` or `wwwroot/css/app.css` inside a `:root {}` selector.
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## Key Rules
|
|
270
|
+
|
|
271
|
+
1. **Always use the MCP theming tools to get token names.** Do not hardcode CSS variable names without first calling `get_component_design_tokens`.
|
|
272
|
+
2. **Only one theme CSS file should be active at a time.** Loading multiple themes causes conflicts.
|
|
273
|
+
3. **CSS selectors use `igc-` tag names, not Razor component names.** `igc-button::part(base)`, not `IgbButton::part(base)`.
|
|
274
|
+
4. **Design token overrides go in a plain CSS file** - there is no Sass step for Blazor theming.
|
|
275
|
+
5. **Scoped theming works by wrapping the component in a container with a CSS class** and scoping the CSS selector to that container.
|
|
276
|
+
6. **`_content/IgniteUI.Blazor/themes/`** is the correct base path for all built-in theme CSS files.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Setting Up the Theming MCP Server
|
|
2
|
+
|
|
3
|
+
> **Part of the [`igniteui-blazor-theming`](../SKILL.md) skill hub.**
|
|
4
|
+
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
- [VS Code](#vs-code)
|
|
8
|
+
- [Cursor](#cursor)
|
|
9
|
+
- [Claude Desktop](#claude-desktop)
|
|
10
|
+
- [WebStorm / JetBrains IDEs](#webstorm--jetbrains-ides)
|
|
11
|
+
- [Verifying the Setup](#verifying-the-setup)
|
|
12
|
+
|
|
13
|
+
The Ignite UI Theming MCP server enables AI assistants to generate Blazor-ready CSS custom properties, palettes, component themes, and global layout tokens. It must be configured in your editor before the theming tools become available.
|
|
14
|
+
|
|
15
|
+
## VS Code
|
|
16
|
+
|
|
17
|
+
Create or edit `.vscode/mcp.json` in your project:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"servers": {
|
|
22
|
+
"igniteui-theming": {
|
|
23
|
+
"command": "npx",
|
|
24
|
+
"args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
This works whether `igniteui-theming` is installed locally in `node_modules` or needs to be pulled from the npm registry; `npx -y` handles both cases.
|
|
31
|
+
|
|
32
|
+
## Cursor
|
|
33
|
+
|
|
34
|
+
Create or edit `.cursor/mcp.json`:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"mcpServers": {
|
|
39
|
+
"igniteui-theming": {
|
|
40
|
+
"command": "npx",
|
|
41
|
+
"args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Claude Desktop
|
|
48
|
+
|
|
49
|
+
Edit the Claude Desktop config file:
|
|
50
|
+
|
|
51
|
+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
52
|
+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"mcpServers": {
|
|
57
|
+
"igniteui-theming": {
|
|
58
|
+
"command": "npx",
|
|
59
|
+
"args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## WebStorm / JetBrains IDEs
|
|
66
|
+
|
|
67
|
+
1. Go to **Settings -> Tools -> AI Assistant -> MCP Servers**
|
|
68
|
+
2. Click **+ Add MCP Server**
|
|
69
|
+
3. Set Command to `npx` and Arguments to `igniteui-theming igniteui-theming-mcp`
|
|
70
|
+
4. Click OK and restart the AI Assistant
|
|
71
|
+
|
|
72
|
+
## Verifying the Setup
|
|
73
|
+
|
|
74
|
+
After configuring the MCP server, ask your AI assistant:
|
|
75
|
+
|
|
76
|
+
> "Read the Ignite UI theming resource for the Blazor platform"
|
|
77
|
+
|
|
78
|
+
If the MCP server is running, the assistant can call
|
|
79
|
+
`read_resource` and return the Blazor theming
|
|
80
|
+
guidance. For Blazor-specific theming, pass
|
|
81
|
+
`platform: "blazor"` to theming tools that accept a platform parameter.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ControlExtraConfiguration, ProjectTemplate } from "@igniteui/cli-core";
|
|
2
|
+
export declare class IgbAiConfigPartial implements ProjectTemplate {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
framework: string;
|
|
7
|
+
projectType: string;
|
|
8
|
+
dependencies: string[];
|
|
9
|
+
hasExtraConfiguration: boolean;
|
|
10
|
+
isHidden: boolean;
|
|
11
|
+
delimiters: import("@igniteui/cli-core").TemplateDelimiters;
|
|
12
|
+
get templatePaths(): string[];
|
|
13
|
+
installModules(): void;
|
|
14
|
+
upgradeIgniteUIPackages(_projectPath: string, _packagePath: string): Promise<boolean>;
|
|
15
|
+
generateConfig(_name: string, _theme: string, ..._options: any[]): {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
getExtraConfiguration(): ControlExtraConfiguration[];
|
|
19
|
+
setExtraConfiguration(_extraConfigKeys: {}): void;
|
|
20
|
+
}
|
|
21
|
+
declare const _default: IgbAiConfigPartial;
|
|
22
|
+
export default _default;
|