igniteui-cli 15.5.1 → 15.6.1
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/package.json +4 -4
- package/templates/blazor/igb/projects/ai-config/files/skills/AGENTS.md +6 -3
- package/templates/blazor/igb/projects/ai-config/files/skills/README.md +30 -45
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/SKILL.md +48 -96
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/charts.md +61 -238
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/data-display.md +60 -193
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/feedback.md +36 -92
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/form-controls.md +66 -224
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout-manager.md +39 -88
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout.md +75 -152
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/setup.md +40 -149
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/SKILL.md +58 -243
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/references/component-mapping.md +89 -280
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/references/gotchas.md +143 -431
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/SKILL.md +91 -157
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/data-operations.md +50 -228
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/editing.md +61 -222
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/features.md +67 -360
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/grid-migration.md +55 -236
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/paging-remote.md +53 -202
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/sizing.md +31 -232
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/state.md +27 -119
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/structure.md +88 -363
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/types.md +87 -415
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-lite-testing/SKILL.md +8 -4
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-lite-testing/references/interop-contracts.md +42 -6
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/SKILL.md +83 -211
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/references/common-patterns.md +93 -184
- package/templates/react/igr-ts/avatar/default/files/src/app/__path__/__filePrefix__.tsx +3 -3
- package/templates/react/igr-ts/avatar/default/files/src/app/__path__/style.module.css +9 -0
- package/templates/react/igr-ts/button/default/files/src/app/__path__/__filePrefix__.tsx +1 -1
- package/templates/react/igr-ts/button/default/files/src/app/__path__/style.module.css +3 -0
- package/templates/react/igr-ts/icon/default/files/src/app/__path__/__filePrefix__.tsx +2 -2
- package/templates/react/igr-ts/icon/default/files/src/app/__path__/style.module.css +3 -0
- package/templates/react/igr-ts/icon-button/default/files/src/app/__path__/__filePrefix__.tsx +1 -1
- package/templates/react/igr-ts/icon-button/default/files/src/app/__path__/style.module.css +3 -0
- package/templates/react/igr-ts/pivot-grid/basic/files/src/app/__path__/__filePrefix__.tsx +3 -4
- package/templates/react/igr-ts/projects/_base/files/package.json +1 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/README.md +30 -83
- package/templates/react/igr-ts/projects/ai-config/files/skills/grid-lite-to-igr-grid-migration/SKILL.md +98 -191
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/SKILL.md +38 -147
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/COMPONENTS.md +65 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/DATAVIZ.md +90 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/MCP.md +43 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/TROUBLESHOOTING.md +17 -145
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/USAGE.md +85 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/SKILL.md +83 -135
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/CSS-THEMING.md +51 -218
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/SKILL.md +58 -187
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/reference/gotchas.md +55 -154
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-optimize-bundle-size/SKILL.md +48 -401
- package/templates/webcomponents/igc-ts/avatar/default/files/src/app/__path__/__filePrefix__.ts +7 -2
- package/templates/webcomponents/igc-ts/button/default/files/src/app/__path__/__filePrefix__.ts +8 -3
- package/templates/webcomponents/igc-ts/card/default/files/src/app/__path__/__filePrefix__.ts +3 -1
- package/templates/webcomponents/igc-ts/constants.d.ts +5 -5
- package/templates/webcomponents/igc-ts/constants.js +5 -5
- package/templates/webcomponents/igc-ts/date-time-input/default/files/src/app/__path__/__filePrefix__.ts +8 -2
- package/templates/webcomponents/igc-ts/icon/default/files/src/app/__path__/__filePrefix__.ts +7 -3
- package/templates/webcomponents/igc-ts/icon-button/default/files/src/app/__path__/__filePrefix__.ts +8 -2
- package/templates/webcomponents/igc-ts/projects/_base/files/package.json +1 -1
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/package.json +6 -6
- package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/README.md +1 -0
- package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/login-bar/login-bar.ts +1 -1
- package/templates/webcomponents/igc-ts/tabs/default/files/src/app/__path__/__filePrefix__.ts +21 -15
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/mcp-setup.md +0 -78
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/mcp-setup.md +0 -78
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/references/mcp-setup.md +0 -81
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/CHARTS-GRIDS.md +0 -398
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/COMPONENT-CATALOGUE.md +0 -161
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/EVENT-HANDLING.md +0 -72
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/INSTALLATION.md +0 -139
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/JSX-PATTERNS.md +0 -187
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/MCP-SERVER.md +0 -77
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/REFS-FORMS.md +0 -232
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/MCP-SERVER.md +0 -67
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/TROUBLESHOOTING.md +0 -35
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/reference/component-mapping.md +0 -132
- /package/templates/webcomponents/igc-ts/tabs/default/files/src/app/__path__/{__filePrefix__.test → __filePrefix__.test.ts} +0 -0
package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-lite-testing/SKILL.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
license: MIT
|
|
2
3
|
name: igniteui-blazor-lite-testing
|
|
3
4
|
description: "Testing in the IgniteUI Blazor (Lite) repository itself: the bUnit unit suite (tests/IgniteUI.Blazor.Tests — base classes, attribute/serialization specs, declarative interop wire contracts) and the Playwright integration suite (tests/IgniteUI.Blazor.Lite.IntegrationTests + TestBed — reflection-driven live-browser sweep, componentsConfig.json). Use when adding or changing tests in this repo, covering a new component, pinning interop behavior, or deciding which suite a check belongs in. Not for consumer-facing component usage — use igniteui-blazor-components for that."
|
|
4
5
|
user-invocable: true
|
|
@@ -20,13 +21,14 @@ Three test projects under `tests/`, two suites:
|
|
|
20
21
|
|---|---|
|
|
21
22
|
| Property → rendered attribute (direct-render components) | unit: plain bUnit facts (`cut.Find(...).GetAttribute(...)`) |
|
|
22
23
|
| Markup/child content rendering | unit: plain bUnit facts |
|
|
24
|
+
| **Parent/child collection membership** — a child registering itself into its parent's collection and leaving again over the child's lifetime | unit: plain bUnit facts in the *parent's* suite, in a `#region Child collection lifecycle` — membership only; name resolution *off* that collection is interop behavior and stays in the contract |
|
|
23
25
|
| Message-borne state serialization shapes | unit: `PropertySerializationTests` / `EnumSerializationTests` / `RenderingSerializationTests` |
|
|
24
|
-
| **Interop wire behavior** — method identifiers, argument serialization + type tags, return decoding, event-handler registration/removal transmissions + JS→.NET event dispatch, interop-borne props/data | unit: the component's `ComponentContract` — full authoring guide: [`references/interop-contracts.md`](./references/interop-contracts.md) |
|
|
26
|
+
| **Interop wire behavior** — method identifiers, argument serialization + type tags, return decoding, event-handler registration/removal transmissions + JS→.NET event dispatch, `@bind-` two-way round trips, interop-borne props/data | unit: the component's `ComponentContract` — full authoring guide: [`references/interop-contracts.md`](./references/interop-contracts.md) |
|
|
25
27
|
| `<Member>Script` parameters (JS-side handlers/providers) | unit: automated sweep (`ScriptPropTests`, all components at once — no per-contract entries, no integration coverage exists) |
|
|
26
28
|
| End-to-end prop/event/method behavior against the **real web component in a real browser** | integration: the TestBed sweep |
|
|
27
29
|
| Visual output, client-side component logic | integration / e2e — never unit |
|
|
28
30
|
|
|
29
|
-
The
|
|
31
|
+
The suites overlap on purpose but answer different questions. Integration proves the full pipeline works end-to-end, but can't attribute a failure to a side of the boundary and skips everything excluded in `componentsConfig.json`. Interop contracts pin the .NET side of the wire protocol at unit speed, per member — including the members integration excludes — and tolerate different implementations through the `InteropHarness` seam (`InteropHarnessRegistry` swaps stacks per component).
|
|
30
32
|
|
|
31
33
|
## Unit suite (`tests/IgniteUI.Blazor.Tests`)
|
|
32
34
|
|
|
@@ -49,6 +51,7 @@ dotnet test tests/IgniteUI.Blazor.Tests -f net10.0 --nologo --filter "FullyQuali
|
|
|
49
51
|
- Generally follow **one file per component: `<Name>Tests.cs` holds `<Name>Tests`.** A component's **child** components may share the parent's file (`SelectTests.cs` also holds `SelectItemTests`/`SelectGroupTests`/`SelectHeaderTests`; likewise Card, List, Dropdown, NavDrawer, Tabs, Stepper, TileManager, Tree, Rating, Slider) — that's the only permitted multi-class file. Cross-cutting suites (`BaseControlTests`, `*SerializationTests`, `ScriptPropTests`, `Interop*Tests`) are keyed to a class/behavior, not a component, and keep their own files.
|
|
50
52
|
- New facts go into the existing `<Name>Tests` class; if the class carries a contract, plain bUnit facts sit alongside the contract runners in the same class.
|
|
51
53
|
- Shared test helpers live in `ElementAssertionExtensions.cs`.
|
|
54
|
+
- **Readable arrange/act/assert in the test beats sharing.** A little repetition across suites is fine; extract obvious repeated mechanics if needed, but ensure those are well documented and easy to grasp without breaking the flow of the test itself.
|
|
52
55
|
- **Skips need a mechanism reason.** Bug-tracker or `componentsConfig.json` listings are not skip reasons. If a member's decode hits a gap in shared infrastructure the change doesn't own, cover it pinning current behavior and write the *correct* assertion commented out under a `// TODO:` explaining the gap — ready to uncomment when fixed. A gap in a component under construction is a bug to fix, not to pin — see the two authoring modes in the interop reference.
|
|
53
56
|
- Components are `partial` — the generated `src/components/Blazor/<Name>.cs` is not the whole class; always check `src/componentsBase/WebInputs/<Name>.cs` for hand-written extensions before drawing conclusions.
|
|
54
57
|
- Formatting: only `dotnet format whitespace --folder` is safe in this repo — a full `dotnet format` writes conflict markers into multi-targeted sources.
|
|
@@ -78,5 +81,6 @@ over the component's public surface —
|
|
|
78
81
|
## Adding coverage for a new component — checklist
|
|
79
82
|
|
|
80
83
|
1. Unit suite: bUnit facts for rendered attributes/markup; if the component has an interop surface (it sends interop invocations or registers JS-originated event handlers — the reference explains how to identify these per stack), add a `ComponentContract` per [`references/interop-contracts.md`](./references/interop-contracts.md). For a brand-new component this works TDD-style: author the contract first from the intended API following the library's conventions; the contract doubles as the API design record (spec mode in the reference).
|
|
81
|
-
2.
|
|
82
|
-
3.
|
|
84
|
+
2. If it is a parent that collects children, or a child that registers with a parent, exercise that membership **over the child's lifetime**, not just at first render: the children are the collection in order, a disposed child leaves it, all disposed empties it. Keep these facts to membership and asserting resolution that are covered by the interop contract.
|
|
85
|
+
3. Integration: the sweep picks the component up automatically; add `componentsConfig.json` entries only for members the generic sweep genuinely cannot model (cite why), and mirror each exclusion with unit contract coverage.
|
|
86
|
+
4. Verify: unit full-suite on all TFMs, plus the component's integration fixture.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Goal: every component with an interop surface carries a declarative `ComponentContract<TComponent>` in its test suite, pinning how its public API maps onto the wire — method identifiers, argument serialization and type tags, return decoding, and event names + args deserialization. Contracts run through the `InteropHarness` seam (`tests/IgniteUI.Blazor.Tests/Interop/`), so the contract verifies a component regardless of the interop stack (swap per component via `InteropHarnessRegistry`).
|
|
4
4
|
|
|
5
|
-
Scope note: contracts cover **methods, current-state getters, events, and props that travel over interop**. Simple property → attribute rendering (direct-render components) is already covered by the existing attribute tests and the integration suite — never duplicate it with `.Prop`.
|
|
5
|
+
Scope note: contracts cover **methods, current-state getters, events, two-way binding pairs, and props that travel over interop**. Simple property → attribute rendering (direct-render components) is already covered by the existing attribute tests and the integration suite — never duplicate it with `.Prop`.
|
|
6
6
|
|
|
7
7
|
Exemplars to imitate: `ButtonTests.cs` (simplest), `CarouselTests.cs` (void/bool methods, args, getters, number event), `ChipTests.cs` (bool-detail events, getter), `ChatTests.cs` (renderer-container component: `.Prop` config object, complex event args), `ComboTests.cs` (data sources, uuid refs), `TreeTests.cs` (child refs, hosted getter).
|
|
8
8
|
|
|
@@ -31,7 +31,8 @@ Read the component's source (all `partial` parts) and find every place it:
|
|
|
31
31
|
|
|
32
32
|
1. **sends an outbound interop invocation** from a public API member → a `.Method` or `.Getter` spec;
|
|
33
33
|
2. **registers a handler for a JS-originated event** (paired with an `EventCallback<TArgs>` parameter) → an `.Event` spec;
|
|
34
|
-
3. **transmits state over interop** rather than rendering it as an attribute → a `.Prop` spec
|
|
34
|
+
3. **transmits state over interop** rather than rendering it as an attribute → a `.Prop` spec;
|
|
35
|
+
4. **pairs a `[Parameter] X` with an `EventCallback<TValue> XChanged`** (what `@bind-X` needs) → a `.Bind` spec.
|
|
35
36
|
|
|
36
37
|
The *concrete idioms* for all three depend on which interop stack the component currently sits on — the [cheat-sheet below](#current-stack-cheat-sheet-legacy-renderermessage-pipeline) lists them for the legacy `RendererMessage` pipeline. For a component on a different stack, find the equivalent call sites in its implementation (whatever sits between the public member and the JS runtime — a direct `IJSRuntime.InvokeAsync`, a channel service, etc.); the principles and the DSL below are unchanged.
|
|
37
38
|
|
|
@@ -48,6 +49,16 @@ wire: FromRender.Of<object?>((interop, cut) => new RawJson(...)) // a prop w
|
|
|
48
49
|
|
|
49
50
|
The render scope handed to the lambda is the cut for an arranged spec and the whole host render for a hosted one — the same scope the spec's own `assert:` receives. Pair it with `arrange:` (or `host:`/`target:`) so there is something rendered to reference.
|
|
50
51
|
|
|
52
|
+
### Dates
|
|
53
|
+
|
|
54
|
+
Decoding converts to local time (`ReturnToDate`, default `RoundTripDateConversion.Auto`), so a decoded date is `Kind=Local` with a shifted reading. Rules:
|
|
55
|
+
|
|
56
|
+
- State every date **expectation** as the UTC instant with an explicit `DateTimeKind.Utc` — `returns:`, `expect:`, args. The runner compares against its local rendering and asserts the kind; an `Unspecified` expectation throws.
|
|
57
|
+
- Never write `.ToLocalTime()` in a spec to make a comparison pass. If one seems needed, the assertion helper is missing a case — add it there. The one exception is an author-written `assert:` lambda, where you do the comparing: use `…Utc).ToLocalTime()` (see `DateRangePickerTests`' bind assert).
|
|
58
|
+
- Outbound dates (`.Prop` values, method args) are not decoded and keep the kind the spec wrote, so their wire expectation is a plain literal — `DateTimeKind.Utc` serializes with `Z`.
|
|
59
|
+
|
|
60
|
+
Exemplars: `CalendarTests` (scalar + array), `DateRangePickerTests` (nested in an object), `DatePickerTests`/`DateTimeInputTests` (nullable, with a `// TODO:` for the cleared case crossing as `MinValue`).
|
|
61
|
+
|
|
51
62
|
### 1. Methods and getters
|
|
52
63
|
|
|
53
64
|
- Every public API member that produces an outbound invocation gets a spec. Distinguish two kinds:
|
|
@@ -58,7 +69,7 @@ The render scope handed to the lambda is the cut for an arranged spec and the wh
|
|
|
58
69
|
| Return kind | Contract form |
|
|
59
70
|
|---|---|
|
|
60
71
|
| none | omit — void overload |
|
|
61
|
-
| scalar (bool/number/string/date) | just the value: `returns: true` / `5.0` / a UTC `DateTime` — the wire return kind is derived from the value's type, and the decoded .NET return must round-trip back to it (dates
|
|
72
|
+
| scalar (bool/number/string/date) | just the value: `returns: true` / `5.0` / a UTC `DateTime` — the wire return kind is derived from the value's type, and the decoded .NET return must round-trip back to it (dates: see the rule above — stated as the UTC instant, asserted as its local rendering) |
|
|
62
73
|
| single serialized object | arranged `Getter` overload with `InteropReturn.Object(...)` + value-level `assert:` — see `ChatTests.cs` `DraftMessage` |
|
|
63
74
|
| array of component/data-item references | arranged `Getter` overload with `InteropReturn.Array` of refs, `Assert.Same` against arranged instances — see `TileManagerTests.cs` `Tiles`, `ComboTests.cs` `Value` |
|
|
64
75
|
| single bound-object reference | arranged `Getter` overload with `InteropReturn.Ref(...)`, `Assert.Same` against the arranged child — see `SelectTests.cs`/`DropdownTests.cs` `SelectedItem` |
|
|
@@ -92,6 +103,25 @@ The contract entry is the member selector plus a sample value: the wire name is
|
|
|
92
103
|
- **Data sources** (`Data`/`DataSource` props): covered by `.Prop(c => c.Data, ...)` too — the harness follows whatever indirection the stack uses to the actual transfer. Item property names cross with their .NET names (not camelized). See `ComboTests.cs`.
|
|
93
104
|
- **Props referencing data items** (e.g. Combo's `Value`): add `arrange:` for the `Data` the value points into and state the wire value late, since tracked items cross as refs whose ids are only assigned on transfer: `.Prop(c => c.Value, [_item1], wire: FromRender.Of<object?>((interop, cut) => new RawJson(...)), arrange: ps => ps.Add(c => c.Data, items))`.
|
|
94
105
|
|
|
106
|
+
### 4. Two-way binding pairs
|
|
107
|
+
|
|
108
|
+
A `[Parameter] TValue X` plus `EventCallback<TValue> XChanged` is what `@bind-X` needs. `XChanged` is a filtered proxy of a **driving event** (`Change`, or `Select` on Chip): assigning it force-binds a no-op onto that event so it registers, and the callback then fires from inside that event's handler with the value projected out of its detail. A client change only ever arrives as a dispatch of the driving event.
|
|
109
|
+
|
|
110
|
+
`.Bind` covers what `.Event` can't: it renders the pair with real two-way binding and asserts the **property adopted the value** — what `@bind-X` consumers depend on. (`.Event(c => c.XChanged, …, name: "Change")` does work for the callback half alone, since binding it registers the driving event; it just says nothing about the property.)
|
|
111
|
+
|
|
112
|
+
```csharp
|
|
113
|
+
.Bind(c => c.Selected, c => c.SelectedChanged, via: c => c.Select,
|
|
114
|
+
argsJson: """{"detail": true}""", expect: true)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
One dispatch pins: the driving event's registration crossed, the callback member kept the callback, the binding received the decoded value, and the property adopted it. Clearing the parameter then has to stop the callback. Payload is the same shape and can be reused from the driving event's own `.Event` spec.
|
|
118
|
+
|
|
119
|
+
- `expect:` is the value the dispatch must produce, often a projection of the detail — a checkbox detail is an object, the bound value is its `checked` field. The runner checks the property doesn't already hold it, so a spec can't pass without the change happening. For a type with no value equality add `assert:` and check field-wise.
|
|
120
|
+
- `arrange:` when the dispatch needs more — Calendar's `Selection` for the `Values` branch, Combo's `Data`. Order the named arguments arrange → argsJson → expect, so a spec reads arrange/act/assert.
|
|
121
|
+
- `initial:` only for a pair that must start somewhere other than the type default; no current spec needs it.
|
|
122
|
+
- A pair with no event of its own (`IgbTab.Selected`, written by `IgbTabs`' `Change` handler) is not a `.Bind` spec: cover it in the parent's `.Event` spec, whose arrange binds each child's `XChanged` to a holder the assert then checks.
|
|
123
|
+
- Nothing checks the value going back out: the client already holds it, and the property's own `.Prop` spec (or its rendered-attribute fact) pins how it serializes. `.Bind` is the inbound direction only.
|
|
124
|
+
|
|
95
125
|
## Current-stack cheat-sheet (legacy `RendererMessage` pipeline)
|
|
96
126
|
|
|
97
127
|
> Everything in this section is specific to components still on the legacy
|
|
@@ -114,7 +144,7 @@ The contract entry is the member selector plus a sample value: the wire name is
|
|
|
114
144
|
| `ObjectToParam(x, typeof(SomeEnum))`, tag `"Json"` | `SomeEnum.Member` | the `[WCEnumName("...")]` value if the member has one, else camelCase of the member name (`Next` → `"next"`) |
|
|
115
145
|
| `ObjectToParam(x)` with a plain string, tag `"Json"` | `"item-1"` | `"item-1"` |
|
|
116
146
|
| `ObjectToParam(x)` with a marshal-by-value object, tag `"Json"` | an options object | `new JsonSubset("""{"key": value, ...}""")` |
|
|
117
|
-
| `x` DateTime, tag `"Date"` | a `DateTime` | the same `DateTime`
|
|
147
|
+
| `x` DateTime, tag `"Date"` | a `DateTime` | the same `DateTime` — outbound, so it keeps the kind the spec wrote |
|
|
118
148
|
| array helpers (`IntArrayToString`, ...), tag `"NumberArray"` etc. | array | `new RawJson("[1,2,3]")` |
|
|
119
149
|
| `ComponentToJson(x, i)`, tag `"Component"` | an `Igb*` component | `"containerId:::<that component's own container id>"` (a `FromRender` value) — no element handle |
|
|
120
150
|
| `ComponentToJson(x, i)`, tag `"Component"` | an `ElementReference` | `"elementIndex:::<i>"`, plus the handle itself declared via `elements:` (it rides beside the arguments, not in them) |
|
|
@@ -144,7 +174,8 @@ public class <Name>Tests : ComponentWithContractTestBase<Igb<Name>>
|
|
|
144
174
|
.Method(c => c.ShowAsync(), c => c.Show(), "show", returns: true)
|
|
145
175
|
.Getter(c => c.GetCurrentValueAsync(), c => c.GetCurrentValue(), "Value", returns: ...)
|
|
146
176
|
.Event(c => c.SomeEvent, ...)
|
|
147
|
-
.Prop(c => c.SomeProp, ...)
|
|
177
|
+
.Prop(c => c.SomeProp, ...)
|
|
178
|
+
.Bind(c => c.Value, c => c.ValueChanged, via: c => c.Change, argsJson: ..., initial: ..., expect: ...);
|
|
148
179
|
|
|
149
180
|
// One runner fact per non-empty contract section (omit facts for empty sections
|
|
150
181
|
[Fact]
|
|
@@ -156,6 +187,9 @@ public class <Name>Tests : ComponentWithContractTestBase<Igb<Name>>
|
|
|
156
187
|
[Fact]
|
|
157
188
|
public void Events_FollowContract() => VerifyEventContract();
|
|
158
189
|
|
|
190
|
+
[Fact]
|
|
191
|
+
public void Binds_FollowContract() => VerifyBindContract();
|
|
192
|
+
|
|
159
193
|
// ... other/existing facts ...
|
|
160
194
|
}
|
|
161
195
|
```
|
|
@@ -174,11 +208,13 @@ Common failures:
|
|
|
174
208
|
- Types/args mismatch → the assertion message shows the recorded wire values; judge which side is off per the authoring modes (in spec mode an unintended wire value is the implementation's bug — the red spec is doing its job).
|
|
175
209
|
- A method call that never returns (test timeout) means its identifier reached JS without a stub match — check the name matches the stub you declared (getters: bare property name).
|
|
176
210
|
- `no property update transmission was observed` → wrong wire name, an attribute-rendered prop, or a serialization exception upstream (nothing transmits at all).
|
|
211
|
+
- `transmitted no "<Event>" event registration` (bind specs) → the pair's `EnsureXHandled()` isn't running, or `via:` names the wrong event; without it the client never reports changes.
|
|
212
|
+
- `the <X>Changed binding was never invoked` → dispatch failures are swallowed by the control, so this one message covers three causes: wrong `via:`, a payload the args type doesn't decode, or a value that doesn't coerce to the bound type.
|
|
177
213
|
|
|
178
214
|
Finish with a full-suite sanity run: same command without `--filter`.
|
|
179
215
|
|
|
180
216
|
## Definition of done (per component)
|
|
181
217
|
|
|
182
218
|
- Contract on exactly one suite, all facts green, plus full suite green on all TFMs.
|
|
183
|
-
- Every public method that goes out through interop — async **and** its sync twin (declared together via the twin overloads) — every registered JS-originated event,
|
|
219
|
+
- Every public method that goes out through interop — async **and** its sync twin (declared together via the twin overloads) — every registered JS-originated event, every interop-borne prop, and every `@bind-` pair is either covered, globally excluded, or named in the skip comment with a mechanism reason — nothing silently omitted. (`<Member>Script` params are covered by the `ScriptPropTests` sweep.)
|
|
184
220
|
- Implementation issues found along the way are handled per the authoring modes (`// TODO:` markers or fixes), never silently skipped.
|
package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/SKILL.md
CHANGED
|
@@ -1,260 +1,132 @@
|
|
|
1
1
|
---
|
|
2
|
+
license: MIT
|
|
2
3
|
name: igniteui-blazor-theming
|
|
3
|
-
description: "
|
|
4
|
+
description: "Theming and visual customization for Ignite UI for Blazor: choosing and switching the built-in Bootstrap, Material, Fluent and Indigo themes in light or dark, scoping a theme to part of the page with IgbThemeProvider, generating palettes and component design tokens with the igniteui-theming MCP server, overriding CSS custom properties, using CSS shadow parts, dark mode, and global roundness/spacing/size tokens. Use when changing the look and feel of Ignite UI Blazor components, applying a color scheme, or writing component CSS. For component configuration use igniteui-blazor-components; for grid data features use igniteui-blazor-grids."
|
|
4
5
|
user-invocable: true
|
|
5
6
|
---
|
|
6
7
|
|
|
7
|
-
# Ignite UI for Blazor - Theming
|
|
8
|
+
# Ignite UI for Blazor - Theming & Styling
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
Blazor theming is **CSS-first**: a built-in theme stylesheet plus CSS custom properties. There is no Sass step. Ignite UI components render as web components with `igc-*` tag names, so every CSS selector targets `igc-button`, never `IgbButton`.
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
## How to use this skill
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
1. Identify the layer you need to change — the table below.
|
|
15
|
+
2. For anything version-specific (palette variables, component token names, layout token CSS), call the `igniteui-theming` MCP tools rather than writing names from memory. Token names are not guessable from component names.
|
|
16
|
+
3. Read [`references/common-patterns.md`](./references/common-patterns.md) for theme switching, dark mode, scoped overrides, and `::part()` recipes.
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
- A theme CSS file and `_content/IgniteUI.Blazor/app.bundle.js` runtime script 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
|
+
**Without the MCP server this skill still works** for theme selection, `IgbThemeProvider`, dark mode, and CSS structure. What it cannot give you is the exact set of `--ig-<component>-<token>` names — in that case say the token list was not verified, or read the generated theme CSS in `_content/IgniteUI.Blazor/themes/` to confirm. Do not configure MCP unprompted; see [MCP server (optional)](#mcp-server-optional).
|
|
18
19
|
|
|
19
|
-
|
|
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 |
|
|
20
|
+
| Layer | Mechanism |
|
|
39
21
|
|---|---|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
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.
|
|
22
|
+
| Baseline look | One built-in theme stylesheet: Bootstrap, Material, Fluent, Indigo × light, dark |
|
|
23
|
+
| Theme for a page region | `IgbThemeProvider` component |
|
|
24
|
+
| Global colors | Palette CSS custom properties in `:root` (`create_palette`) |
|
|
25
|
+
| One component's appearance | Component design tokens (`get_component_design_tokens` → `create_component_theme`) |
|
|
26
|
+
| Internal parts a token doesn't cover | `::part()` — only after confirming the part name |
|
|
27
|
+
| Global density | `set_roundness`, `set_spacing`, `set_size` |
|
|
69
28
|
|
|
70
|
-
|
|
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"` |
|
|
29
|
+
## Built-in themes
|
|
103
30
|
|
|
104
|
-
|
|
31
|
+
Link exactly **one** stylesheet in the host page; loading two conflicts.
|
|
105
32
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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" }
|
|
33
|
+
```html
|
|
34
|
+
<link href="_content/IgniteUI.Blazor/themes/light/bootstrap.css" rel="stylesheet" />
|
|
35
|
+
<link href="css/app.css" rel="stylesheet" /> <!-- your overrides, after -->
|
|
36
|
+
<script src="_content/IgniteUI.Blazor/app.bundle.js"></script>
|
|
119
37
|
```
|
|
120
38
|
|
|
121
|
-
|
|
39
|
+
Paths are `_content/IgniteUI.Blazor/themes/{light|dark}/{bootstrap|material|fluent|indigo}.css`. Any full-featured grid needs the grid stylesheet in the same variant as well (`themes/grid/light/bootstrap.css`); `IgbGridLite` uses its own package path instead.
|
|
122
40
|
|
|
123
|
-
|
|
41
|
+
## Scoped theming with `IgbThemeProvider`
|
|
124
42
|
|
|
125
|
-
|
|
43
|
+
`IgbThemeProvider` applies a theme and variant to its subtree, overriding the global theme for those components. It is the built-in way to preview themes, theme one region differently, or switch theme at runtime without swapping stylesheets.
|
|
126
44
|
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
surface: "#ffffff",
|
|
135
|
-
variant: "light"
|
|
136
|
-
}
|
|
45
|
+
```razor
|
|
46
|
+
<IgbThemeProvider Theme="Theme.Bootstrap" Variant="ThemeVariant.Dark">
|
|
47
|
+
<IgbCard>
|
|
48
|
+
<IgbCardHeader><h3 slot="title">Dark region</h3></IgbCardHeader>
|
|
49
|
+
<IgbCardContent><IgbButton>Sign In</IgbButton></IgbCardContent>
|
|
50
|
+
</IgbCard>
|
|
51
|
+
</IgbThemeProvider>
|
|
137
52
|
```
|
|
138
53
|
|
|
139
|
-
|
|
54
|
+
`Theme`: `Material` (default), `Bootstrap`, `Indigo`, `Fluent`. `ThemeVariant`: `Light`, `Dark`. Register `IgbThemeProviderModule`. Bind the parameters to fields for a runtime theme switcher — no JS interop and no stylesheet juggling.
|
|
140
55
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
```
|
|
144
|
-
Tool: get_component_design_tokens
|
|
145
|
-
Params: { component: "contained-button" }
|
|
146
|
-
```
|
|
56
|
+
Use it when the change is scoped or interactive. Use a different stylesheet when the whole application should ship with one theme.
|
|
147
57
|
|
|
148
|
-
|
|
58
|
+
## Palettes
|
|
149
59
|
|
|
150
60
|
```
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
output: "css",
|
|
155
|
-
component: "contained-button",
|
|
156
|
-
tokens: {
|
|
157
|
-
"background": "var(--ig-primary-500)",
|
|
158
|
-
"foreground": "var(--ig-primary-500-contrast)"
|
|
159
|
-
}
|
|
160
|
-
}
|
|
61
|
+
create_palette(platform: "blazor", output: "css",
|
|
62
|
+
primary: "#3f51b5", secondary: "#e91e63",
|
|
63
|
+
surface: "#ffffff", variant: "light")
|
|
161
64
|
```
|
|
162
65
|
|
|
163
|
-
Use `
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
66
|
+
- Use `create_palette` with `output: "css"`.
|
|
67
|
+
- The parameter names are `primary` / `secondary` / `surface` (the `primaryColor`-style names belong to `create_theme`).
|
|
68
|
+
- Use `create_custom_palette` only when the design needs explicit control over individual shades.
|
|
69
|
+
- Palette CSS belongs in `:root` in a stylesheet loaded **after** the built-in theme.
|
|
70
|
+
- Shades run `50` (lightest) to `900` (darkest). Do not invert chromatic colors for dark themes — only gray inverts.
|
|
71
|
+
- Surface must match the variant: light surface with `variant: "light"`, dark with `variant: "dark"`. Act on any luminance warning the tool returns.
|
|
72
|
+
- Raw hex belongs in the palette seed. After the palette exists, reference `var(--ig-primary-500)` and `var(--ig-primary-500-contrast)` downstream; `get_color(color: "primary", variant: "600")` resolves a token, with `contrast: true` for the matching text color.
|
|
170
73
|
|
|
171
|
-
|
|
172
|
-
Params: { platform: "blazor", output: "css", spacing: 1.25 }
|
|
74
|
+
## Component design tokens
|
|
173
75
|
|
|
174
|
-
Tool: set_size
|
|
175
|
-
Params: { platform: "blazor", output: "css", size: "small" }
|
|
176
76
|
```
|
|
77
|
+
get_component_design_tokens(component: "contained-button")
|
|
177
78
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
```html
|
|
183
|
-
<link href="_content/IgniteUI.Blazor/themes/light/bootstrap.css" rel="stylesheet" />
|
|
184
|
-
<link href="css/app.css" rel="stylesheet" />
|
|
185
|
-
<script src="_content/IgniteUI.Blazor/app.bundle.js"></script>
|
|
79
|
+
create_component_theme(platform: "blazor", output: "css", component: "contained-button",
|
|
80
|
+
tokens: { "background": "var(--ig-primary-500)",
|
|
81
|
+
"foreground": "var(--ig-primary-500-contrast)" })
|
|
186
82
|
```
|
|
187
83
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
Use `read_resource` with these URIs for preset values and documentation:
|
|
84
|
+
- **Always discover before you write.** Use only token names the tool returned.
|
|
85
|
+
- The argument is `tokens`, not `overrides`.
|
|
86
|
+
- Query the **exact variant** for variant-based components: `contained-button`, `flat-button`, `outlined-button`, `fab-button` — not plain `button`.
|
|
87
|
+
- If the response separates primary from refinement tokens, use the primary ones unless the user asked for a specific state or subpart.
|
|
88
|
+
- Compound components: follow the checklist in the tool's response. Standard compounds want the related child themes generated and scoped under the parent selector; composed compounds want only the parent's tokens.
|
|
89
|
+
- Charts, maps, gauges, and sparklines have **no** design tokens — style them through component parameters instead ([`charts.md`](../igniteui-blazor-components/references/charts.md)).
|
|
195
90
|
|
|
196
|
-
|
|
197
|
-
|---|---|
|
|
198
|
-
| `theming://platforms/blazor` | Blazor platform specifics |
|
|
199
|
-
| `theming://presets/palettes` | Preset palette colors |
|
|
200
|
-
| `theming://guidance/colors/usage` | Which shades to use for which purpose |
|
|
201
|
-
| `theming://guidance/colors/roles` | Semantic color roles |
|
|
202
|
-
| `theming://guidance/colors/rules` | Light/dark theme color rules |
|
|
203
|
-
|
|
204
|
-
## Mandatory Agent Protocol
|
|
91
|
+
## Global layout tokens
|
|
205
92
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
93
|
+
| Goal | Tool | Value |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| Roundness | `set_roundness` | `radiusFactor: 0..1` |
|
|
96
|
+
| Spacing | `set_spacing` | `spacing: number`, optional `inline` / `block` |
|
|
97
|
+
| Size / density | `set_size` | `size: "small" \| "medium" \| "large"` |
|
|
210
98
|
|
|
211
|
-
|
|
212
|
-
Map the user's request to one or more rows in the Task to Reference File table below.
|
|
99
|
+
All take `platform: "blazor"`, `output: "css"`, and their output goes in `:root`. Do not use the legacy names `compact` / `cosy` / `comfortable`.
|
|
213
100
|
|
|
214
|
-
|
|
215
|
-
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.
|
|
101
|
+
## Where generated CSS goes
|
|
216
102
|
|
|
217
|
-
**
|
|
218
|
-
|
|
103
|
+
- **Global stylesheet** (`wwwroot/css/app.css`) — use MCP output as-is, loaded after the built-in theme.
|
|
104
|
+
- **`.razor.css` isolation file** — prefix every `igc-*` selector with `::deep`, or CSS isolation blocks it. Never add `::deep` to a `:root {}` block or a plain HTML class selector.
|
|
105
|
+
- Palette and layout tokens go in `:root`; component themes go on the `igc-*` selector or a scoped wrapper.
|
|
219
106
|
|
|
220
|
-
**
|
|
221
|
-
Base CSS and instructions on what the MCP tools return and what the reference files say.
|
|
107
|
+
**Do not overwrite an existing stylesheet.** If `app.css`, `site.css`, or a `.razor.css` already exists, show the generated CSS as an addition for review rather than replacing the file — custom styles are easy to destroy and hard to recover.
|
|
222
108
|
|
|
223
|
-
|
|
109
|
+
## MCP server (optional)
|
|
224
110
|
|
|
225
|
-
|
|
226
|
-
|---|---|
|
|
227
|
-
| 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) |
|
|
228
|
-
| Setting up the MCP theming server in VS Code, Cursor, Claude Desktop, or JetBrains IDEs | [`references/mcp-setup.md`](./references/mcp-setup.md) |
|
|
111
|
+
`igniteui-theming` provides `create_palette`, `create_custom_palette`, `get_color`, `get_component_design_tokens`, `create_component_theme`, `set_roundness`, `set_spacing`, `set_size`, and `read_resource`. Always pass `platform: "blazor"` and `output: "css"` where accepted.
|
|
229
112
|
|
|
230
|
-
|
|
113
|
+
Reference resources: `theming://platforms/blazor`, `theming://presets/palettes`, `theming://guidance/colors/usage`, `theming://guidance/colors/roles`, `theming://guidance/colors/rules`.
|
|
231
114
|
|
|
232
|
-
|
|
233
|
-
>
|
|
234
|
-
> For normal Ignite UI for Blazor app styling, generate CSS custom properties and selectors.
|
|
115
|
+
To enable the server, add to `.vscode/mcp.json` (VS Code, key `servers`):
|
|
235
116
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
117
|
+
```json
|
|
118
|
+
{ "servers": { "igniteui-theming": { "command": "npx", "args": ["-y", "igniteui-theming", "igniteui-theming-mcp"] } } }
|
|
119
|
+
```
|
|
239
120
|
|
|
240
|
-
|
|
241
|
-
>
|
|
242
|
-
> This skill already establishes the platform. When calling Ignite UI Theming MCP tools that accept a platform, always pass `platform: "blazor"`.
|
|
121
|
+
Or `.cursor/mcp.json` / `claude_desktop_config.json` (key `mcpServers`):
|
|
243
122
|
|
|
244
|
-
|
|
123
|
+
```json
|
|
124
|
+
{ "mcpServers": { "igniteui-theming": { "command": "npx", "args": ["-y", "igniteui-theming", "igniteui-theming-mcp"] } } }
|
|
125
|
+
```
|
|
245
126
|
|
|
246
|
-
|
|
247
|
-
2. **Always call `get_component_design_tokens` before component CSS overrides**; token names are not guessable from component names
|
|
248
|
-
3. **Use exact component variants** for variant components, such as `contained-button`, `flat-button`, `outlined-button`, and `fab-button`
|
|
249
|
-
4. **Use `tokens` with `create_component_theme`**; do not use an `overrides` object
|
|
250
|
-
5. **Use palette tokens after palette generation**; raw colors belong in palette seed inputs, not downstream component theme values
|
|
251
|
-
6. **Place generated CSS after the built-in Ignite UI theme CSS** so overrides win in the cascade
|
|
252
|
-
7. **Use `igc-*` selectors in CSS**, not Razor component names such as `IgbButton`
|
|
253
|
-
8. **Use `::part()` only after confirming part names with Blazor docs**, and prefer design tokens when a token exists
|
|
254
|
-
9. **Surface color must match the variant**; use a light surface for `light` and a dark surface for `dark`
|
|
255
|
-
10. **Only one built-in theme CSS file should be active at a time**; link only one theme stylesheet in the host page (e.g., `_content/IgniteUI.Blazor/themes/light/bootstrap.css`) to avoid conflicts
|
|
127
|
+
Reload the editor afterwards. JetBrains: **Settings → Tools → AI Assistant → MCP Servers**, command `npx`, arguments `igniteui-theming igniteui-theming-mcp`.
|
|
256
128
|
|
|
257
|
-
## Related
|
|
129
|
+
## Related skills
|
|
258
130
|
|
|
259
|
-
- [`igniteui-blazor-components`](../igniteui-blazor-components/SKILL.md)
|
|
260
|
-
- [`igniteui-blazor-grids`](../igniteui-blazor-grids/SKILL.md) -
|
|
131
|
+
- [`igniteui-blazor-components`](../igniteui-blazor-components/SKILL.md) — component APIs
|
|
132
|
+
- [`igniteui-blazor-grids`](../igniteui-blazor-grids/SKILL.md) — grid features and the `--ig-size` density scale
|