igniteui-theming 25.0.0-beta.4 → 25.0.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/README.md +283 -5
- package/dist/mcp/generators/css.d.ts +115 -0
- package/dist/mcp/generators/css.js +143 -0
- package/dist/mcp/generators/sass.d.ts +50 -0
- package/dist/mcp/generators/sass.js +272 -0
- package/dist/mcp/index.d.ts +8 -0
- package/dist/mcp/index.js +349 -0
- package/dist/mcp/json/colors/presets/palettes.json.js +13 -0
- package/dist/mcp/json/components/themes.json.js +143 -0
- package/dist/mcp/json/elevations/indigo.json.js +8 -0
- package/dist/mcp/json/elevations/material.json.js +8 -0
- package/dist/mcp/json/typography/presets/typescales.json.js +17 -0
- package/dist/mcp/knowledge/color-usage.d.ts +105 -0
- package/dist/mcp/knowledge/color-usage.js +506 -0
- package/dist/mcp/knowledge/colors.d.ts +64 -0
- package/dist/mcp/knowledge/colors.js +52 -0
- package/dist/mcp/knowledge/component-metadata.d.ts +133 -0
- package/dist/mcp/knowledge/component-metadata.js +616 -0
- package/dist/mcp/knowledge/component-themes.d.ts +89 -0
- package/dist/mcp/knowledge/component-themes.js +68 -0
- package/dist/mcp/knowledge/custom-palettes.d.ts +19 -0
- package/dist/mcp/knowledge/custom-palettes.js +11 -0
- package/dist/mcp/knowledge/docs/colors/guidance.md.js +4 -0
- package/dist/mcp/knowledge/docs/colors/usage.md.js +4 -0
- package/dist/mcp/knowledge/docs/layout/functions/border-radius.md.js +4 -0
- package/dist/mcp/knowledge/docs/layout/functions/pad.md.js +4 -0
- package/dist/mcp/knowledge/docs/layout/functions/sizable.md.js +4 -0
- package/dist/mcp/knowledge/docs/layout/mixins/sizable.md.js +4 -0
- package/dist/mcp/knowledge/docs/layout/mixins/sizing.md.js +4 -0
- package/dist/mcp/knowledge/docs/layout/mixins/spacing.md.js +4 -0
- package/dist/mcp/knowledge/docs/layout/overview.md.js +4 -0
- package/dist/mcp/knowledge/elevations.d.ts +24 -0
- package/dist/mcp/knowledge/elevations.js +13 -0
- package/dist/mcp/knowledge/index.d.ts +16 -0
- package/dist/mcp/knowledge/index.js +94 -0
- package/dist/mcp/knowledge/layout-docs.d.ts +8 -0
- package/dist/mcp/knowledge/multipliers.d.ts +20 -0
- package/dist/mcp/knowledge/palettes.d.ts +59 -0
- package/dist/mcp/knowledge/palettes.js +19 -0
- package/dist/mcp/knowledge/platforms/angular.d.ts +106 -0
- package/dist/mcp/knowledge/platforms/angular.js +199 -0
- package/dist/mcp/knowledge/platforms/blazor.d.ts +54 -0
- package/dist/mcp/knowledge/platforms/blazor.js +141 -0
- package/dist/mcp/knowledge/platforms/common.d.ts +87 -0
- package/dist/mcp/knowledge/platforms/common.js +75 -0
- package/dist/mcp/knowledge/platforms/index.d.ts +152 -0
- package/dist/mcp/knowledge/platforms/index.js +244 -0
- package/dist/mcp/knowledge/platforms/react.d.ts +49 -0
- package/dist/mcp/knowledge/platforms/react.js +135 -0
- package/dist/mcp/knowledge/platforms/webcomponents.d.ts +129 -0
- package/dist/mcp/knowledge/platforms/webcomponents.js +409 -0
- package/dist/mcp/knowledge/sass-api.d.ts +275 -0
- package/dist/mcp/knowledge/typography.d.ts +38 -0
- package/dist/mcp/knowledge/typography.js +5 -0
- package/dist/mcp/resources/index.d.ts +4 -0
- package/dist/mcp/resources/presets.d.ts +162 -0
- package/dist/mcp/resources/presets.js +474 -0
- package/dist/mcp/tools/descriptions.d.ts +107 -0
- package/dist/mcp/tools/descriptions.js +1058 -0
- package/dist/mcp/tools/handlers/color.d.ts +7 -0
- package/dist/mcp/tools/handlers/color.js +66 -0
- package/dist/mcp/tools/handlers/component-theme.d.ts +14 -0
- package/dist/mcp/tools/handlers/component-theme.js +245 -0
- package/dist/mcp/tools/handlers/component-tokens.d.ts +14 -0
- package/dist/mcp/tools/handlers/component-tokens.js +229 -0
- package/dist/mcp/tools/handlers/custom-palette.d.ts +7 -0
- package/dist/mcp/tools/handlers/custom-palette.js +193 -0
- package/dist/mcp/tools/handlers/elevations.d.ts +7 -0
- package/dist/mcp/tools/handlers/elevations.js +30 -0
- package/dist/mcp/tools/handlers/index.d.ts +14 -0
- package/dist/mcp/tools/handlers/layout.d.ts +37 -0
- package/dist/mcp/tools/handlers/layout.js +197 -0
- package/dist/mcp/tools/handlers/palette.d.ts +7 -0
- package/dist/mcp/tools/handlers/palette.js +128 -0
- package/dist/mcp/tools/handlers/platform.d.ts +35 -0
- package/dist/mcp/tools/handlers/platform.js +173 -0
- package/dist/mcp/tools/handlers/resource.d.ts +14 -0
- package/dist/mcp/tools/handlers/resource.js +33 -0
- package/dist/mcp/tools/handlers/theme.d.ts +7 -0
- package/dist/mcp/tools/handlers/theme.js +103 -0
- package/dist/mcp/tools/handlers/typography.d.ts +7 -0
- package/dist/mcp/tools/handlers/typography.js +32 -0
- package/dist/mcp/tools/index.d.ts +5 -0
- package/dist/mcp/tools/schemas.d.ts +867 -0
- package/dist/mcp/tools/schemas.js +221 -0
- package/dist/mcp/utils/color.d.ts +191 -0
- package/dist/mcp/utils/color.js +262 -0
- package/dist/mcp/utils/preprocessing.d.ts +41 -0
- package/dist/mcp/utils/preprocessing.js +34 -0
- package/dist/mcp/utils/result.d.ts +223 -0
- package/dist/mcp/utils/result.js +47 -0
- package/dist/mcp/utils/sass.d.ts +176 -0
- package/dist/mcp/utils/sass.js +194 -0
- package/dist/mcp/utils/types.d.ts +288 -0
- package/dist/mcp/utils/types.js +57 -0
- package/dist/mcp/validators/custom-palette.d.ts +22 -0
- package/dist/mcp/validators/custom-palette.js +257 -0
- package/dist/mcp/validators/index.d.ts +6 -0
- package/dist/mcp/validators/palette.d.ts +115 -0
- package/dist/mcp/validators/palette.js +248 -0
- package/dist/mcp/vite-env.d.ts +18 -0
- package/index.js +5 -5
- package/json/components/bootstrap.json +1 -0
- package/json/components/fluent.json +1 -0
- package/json/components/indigo.json +1 -0
- package/json/components/material.json +1 -0
- package/json/components/themes.json +6890 -0
- package/package.json +41 -16
- package/sass/json/components.scss +52 -0
- package/sass/themes/charts/_theme.scss +12 -12
- package/sass/themes/components/action-strip/_action-strip-theme.scss +9 -4
- package/sass/themes/components/avatar/_avatar-theme.scss +10 -4
- package/sass/themes/components/badge/_badge-theme.scss +9 -5
- package/sass/themes/components/banner/_banner-theme.scss +10 -6
- package/sass/themes/components/bottom-nav/_bottom-nav-theme.scss +16 -9
- package/sass/themes/components/button/_button-theme.scss +19 -13
- package/sass/themes/components/button/_contained-button-theme.scss +27 -22
- package/sass/themes/components/button/_fab-button-theme.scss +28 -22
- package/sass/themes/components/button/_flat-button-theme.scss +26 -19
- package/sass/themes/components/button/_outlined-button-theme.scss +31 -24
- package/sass/themes/components/button-group/_button-group-theme.scss +39 -35
- package/sass/themes/components/calendar/_calendar-theme.scss +51 -45
- package/sass/themes/components/card/_card-theme.scss +11 -6
- package/sass/themes/components/carousel/_carousel-theme.scss +25 -18
- package/sass/themes/components/chat/_chat-theme.scss +24 -17
- package/sass/themes/components/checkbox/_checkbox-theme.scss +21 -13
- package/sass/themes/components/chip/_chip-theme.scss +25 -18
- package/sass/themes/components/column-actions/_column-actions-theme.scss +9 -3
- package/sass/themes/components/combo/_combo-theme.scss +29 -12
- package/sass/themes/components/date-range-picker/_date-range-picker-theme.scss +5 -0
- package/sass/themes/components/dialog/_dialog-theme.scss +10 -4
- package/sass/themes/components/divider/_divider-theme.scss +4 -0
- package/sass/themes/components/dock-manager/_dock-manager-theme.scss +6 -1
- package/sass/themes/components/drop-down/_drop-down-theme.scss +27 -20
- package/sass/themes/components/expansion-panel/_expansion-panel-theme.scss +30 -10
- package/sass/themes/components/grid/_grid-summary-theme.scss +14 -6
- package/sass/themes/components/grid/_grid-theme.scss +77 -66
- package/sass/themes/components/grid/_grid-toolbar-theme.scss +18 -8
- package/sass/themes/components/grid/_pivot-data-selector-theme.scss +5 -0
- package/sass/themes/components/highlight/_highlight-theme.scss +12 -5
- package/sass/themes/components/icon/_icon-theme.scss +4 -0
- package/sass/themes/components/icon-button/_contained-icon-button-theme.scss +24 -16
- package/sass/themes/components/icon-button/_flat-icon-button-theme.scss +22 -13
- package/sass/themes/components/icon-button/_icon-button-theme.scss +19 -9
- package/sass/themes/components/icon-button/_outlined-icon-button-theme.scss +24 -15
- package/sass/themes/components/input/_file-input-theme.scss +24 -16
- package/sass/themes/components/input/_input-theme.scss +54 -27
- package/sass/themes/components/label/_label-theme.scss +4 -0
- package/sass/themes/components/list/_list-theme.scss +35 -28
- package/sass/themes/components/navbar/_navbar-theme.scss +12 -5
- package/sass/themes/components/navdrawer/_navdrawer-theme.scss +20 -13
- package/sass/themes/components/overlay/_overlay-theme.scss +4 -0
- package/sass/themes/components/paginator/_paginator-theme.scss +9 -3
- package/sass/themes/components/progress/_circular-theme.scss +6 -1
- package/sass/themes/components/progress/_linear-theme.scss +5 -0
- package/sass/themes/components/query-builder/_query-builder-theme.scss +22 -13
- package/sass/themes/components/radio/_radio-theme.scss +21 -12
- package/sass/themes/components/rating/_rating-theme.scss +6 -1
- package/sass/themes/components/ripple/_ripple-theme.scss +4 -0
- package/sass/themes/components/scrollbar/_scrollbar-theme.scss +5 -1
- package/sass/themes/components/select/_select-theme.scss +13 -6
- package/sass/themes/components/slider/_slider-theme.scss +24 -15
- package/sass/themes/components/snackbar/_snackbar-theme.scss +10 -5
- package/sass/themes/components/splitter/_splitter-theme.scss +30 -13
- package/sass/themes/components/stepper/_stepper-theme.scss +64 -53
- package/sass/themes/components/switch/_switch-theme.scss +27 -19
- package/sass/themes/components/tabs/_tabs-theme.scss +30 -22
- package/sass/themes/components/time-picker/_time-picker-theme.scss +21 -15
- package/sass/themes/components/toast/_toast-theme.scss +10 -3
- package/sass/themes/components/tooltip/_tooltip-theme.scss +9 -3
- package/sass/themes/components/tree/_tree-theme.scss +21 -13
- package/sass/themes/components/watermark/_watermark-theme.scss +9 -6
- package/sass/themes/schemas/components/dark/_splitter.scss +50 -24
- package/sass/themes/schemas/components/light/_input-group.scss +1 -1
- package/sass/themes/schemas/components/light/_splitter.scss +60 -5
- package/tailwind/utilities/bootstrap.css +1 -1
- package/tailwind/utilities/fluent.css +1 -1
- package/tailwind/utilities/indigo.css +1 -1
- package/tailwind/utilities/material.css +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
<h1 align="center">
|
|
3
2
|
Ignite UI Theming - from Infragistics
|
|
4
3
|
</h1>
|
|
@@ -8,6 +7,7 @@
|
|
|
8
7
|
The Ignite UI Theming repository collects a set of Sass mixins, functions, and variables used to create themes for a variety of UI frameworks built by Infragistics. The theming package makes it super easy to create palettes, elevations and typography styles for your projects.
|
|
9
8
|
|
|
10
9
|
## Palettes
|
|
10
|
+
|
|
11
11
|
We provide four predefined palettes - material, bootstrap, fluent and indigo that have all the necessary colors along with diffent variants of those colors to make it even easier picking the right one for your case. Here's what they look like:
|
|
12
12
|
|
|
13
13
|

|
|
@@ -18,10 +18,10 @@ To access any of the colors in the palettes, you can use the `color` function:
|
|
|
18
18
|
background: color($light-material-palette, 'primary', 500);
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
You can take a further look on what color functions and mixins the package contains and how to use them in the [Colors Wiki Page](https://github.com/IgniteUI/igniteui-theming/wiki/Colors-(Draft))
|
|
22
|
-
|
|
21
|
+
You can take a further look on what color functions and mixins the package contains and how to use them in the [Colors Wiki Page](<https://github.com/IgniteUI/igniteui-theming/wiki/Colors-(Draft)>)
|
|
23
22
|
|
|
24
23
|
## Typography
|
|
24
|
+
|
|
25
25
|
Another valuable module of our theming package is the typography, helping you have consistency all over your project. There are again four typography presets for the four themes that we provide out of the box.
|
|
26
26
|
|
|
27
27
|

|
|
@@ -32,9 +32,10 @@ You can set any of the typefaces by using the `typography` mixin, which accepts
|
|
|
32
32
|
@include typography($font-family: $material-typeface, $type-scale: $material-type-scale);
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Learn more about the typography module in the package by checking out the [Typography Wiki Page](https://github.com/IgniteUI/igniteui-theming/wiki/Typography-(Draft))
|
|
35
|
+
Learn more about the typography module in the package by checking out the [Typography Wiki Page](<https://github.com/IgniteUI/igniteui-theming/wiki/Typography-(Draft)>)
|
|
36
36
|
|
|
37
37
|
## Elevations
|
|
38
|
+
|
|
38
39
|
The theming package is providing one preset of shadows that can be used to give your components a lift. They're super helpful using with buttons, cards, navigation bars, etc.
|
|
39
40
|
|
|
40
41
|

|
|
@@ -45,7 +46,7 @@ You can set elevations 0-24, by using the `elevation` function, which accepts th
|
|
|
45
46
|
box-shadow: elevation(12);
|
|
46
47
|
```
|
|
47
48
|
|
|
48
|
-
Learn more about elevations and their abilities in the [Elevations Wiki Page](https://github.com/IgniteUI/igniteui-theming/wiki/Elevations-(draft))
|
|
49
|
+
Learn more about elevations and their abilities in the [Elevations Wiki Page](<https://github.com/IgniteUI/igniteui-theming/wiki/Elevations-(draft)>)
|
|
49
50
|
|
|
50
51
|
## Usage
|
|
51
52
|
|
|
@@ -106,8 +107,285 @@ npm run serve:docs
|
|
|
106
107
|
## Testing and Debugging
|
|
107
108
|
|
|
108
109
|
### Preview Palettes
|
|
110
|
+
|
|
109
111
|
To preview a palette you can pass the palette (`material`, `bootstrap`, `fluent`, `indigo`) and variant (`light` or `dark`) to the `palette` and `variant` arguments respectively. If you want to output the result to a file in the `./dist` folder add the `out` option.
|
|
110
112
|
|
|
111
113
|
```
|
|
112
114
|
npm run preview:palette -- --palette=material --variant=light --out
|
|
113
115
|
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## MCP Server (AI-Assisted Theming)
|
|
120
|
+
|
|
121
|
+
The Ignite UI Theming package includes a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that enables AI assistants to generate production-ready theming code for your Ignite UI applications.
|
|
122
|
+
|
|
123
|
+
### What is MCP?
|
|
124
|
+
|
|
125
|
+
The Model Context Protocol allows AI assistants (like Claude, GitHub Copilot, and others) to connect to external tools and data sources. The Ignite UI Theming MCP server acts as an expert theming assistant that can:
|
|
126
|
+
|
|
127
|
+
- 🎨 **Generate color palettes** with automatic shade variations
|
|
128
|
+
- 📝 **Create typography systems** following design standards
|
|
129
|
+
- 🌓 **Build complete themes** for light and dark modes
|
|
130
|
+
- 🎯 **Customize components** with design tokens
|
|
131
|
+
- ✅ **Validate colors** for accessibility compliance
|
|
132
|
+
|
|
133
|
+
### Quick Start
|
|
134
|
+
|
|
135
|
+
#### 1. Clone and Build
|
|
136
|
+
|
|
137
|
+
Clone the repository and build the MCP server:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
npm install
|
|
141
|
+
npm run build:mcp
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
#### 2. Configure Your AI Client
|
|
145
|
+
|
|
146
|
+
The MCP server works with any MCP-compatible client. Here are setup instructions for popular clients:
|
|
147
|
+
|
|
148
|
+
<details>
|
|
149
|
+
<summary><strong>VS Code</strong> (with MCP-compatible extensions)</summary>
|
|
150
|
+
|
|
151
|
+
**For local development** - Create or edit `.vscode/mcp.json`:
|
|
152
|
+
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"mcp.servers": {
|
|
156
|
+
"igniteui-theming": {
|
|
157
|
+
"command": "node",
|
|
158
|
+
"args": ["/absolute/path/to/igniteui-theming/dist/mcp/index.js"]
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Using published package**:
|
|
165
|
+
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"mcp.servers": {
|
|
169
|
+
"igniteui-theming": {
|
|
170
|
+
"command": "npx",
|
|
171
|
+
"args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
</details>
|
|
178
|
+
|
|
179
|
+
<details>
|
|
180
|
+
<summary><strong>WebStorm / JetBrains IDEs</strong></summary>
|
|
181
|
+
|
|
182
|
+
1. Go to **Settings → Tools → AI Assistant → MCP Servers**
|
|
183
|
+
2. Click **+ Add MCP Server**
|
|
184
|
+
3. Configure:
|
|
185
|
+
- **Name**: `igniteui-theming`
|
|
186
|
+
- **Command**: `node` (for local) or `npx` (for package)
|
|
187
|
+
- **Arguments**:
|
|
188
|
+
- Local: `/absolute/path/to/igniteui-theming/dist/mcp/index.js`
|
|
189
|
+
- Package: `igniteui-theming igniteui-theming-mcp`
|
|
190
|
+
4. Click **OK** and restart AI Assistant
|
|
191
|
+
|
|
192
|
+
</details>
|
|
193
|
+
|
|
194
|
+
<details>
|
|
195
|
+
<summary><strong>Claude Desktop</strong></summary>
|
|
196
|
+
|
|
197
|
+
Add to your configuration file:
|
|
198
|
+
|
|
199
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
200
|
+
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
201
|
+
|
|
202
|
+
**For local development**:
|
|
203
|
+
|
|
204
|
+
```json
|
|
205
|
+
{
|
|
206
|
+
"mcpServers": {
|
|
207
|
+
"igniteui-theming": {
|
|
208
|
+
"command": "node",
|
|
209
|
+
"args": ["/absolute/path/to/igniteui-theming/dist/mcp/index.js"]
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Using published package**:
|
|
216
|
+
|
|
217
|
+
```json
|
|
218
|
+
{
|
|
219
|
+
"mcpServers": {
|
|
220
|
+
"igniteui-theming": {
|
|
221
|
+
"command": "npx",
|
|
222
|
+
"args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
</details>
|
|
229
|
+
|
|
230
|
+
<details>
|
|
231
|
+
<summary><strong>Cursor</strong></summary>
|
|
232
|
+
|
|
233
|
+
Create or edit `.cursor/mcp.json` in your project:
|
|
234
|
+
|
|
235
|
+
**For local development**:
|
|
236
|
+
|
|
237
|
+
```json
|
|
238
|
+
{
|
|
239
|
+
"mcpServers": {
|
|
240
|
+
"igniteui-theming": {
|
|
241
|
+
"command": "node",
|
|
242
|
+
"args": ["/absolute/path/to/igniteui-theming/dist/mcp/index.js"]
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**Using published package**:
|
|
249
|
+
|
|
250
|
+
```json
|
|
251
|
+
{
|
|
252
|
+
"mcpServers": {
|
|
253
|
+
"igniteui-theming": {
|
|
254
|
+
"command": "npx",
|
|
255
|
+
"args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
</details>
|
|
262
|
+
|
|
263
|
+
### What Can It Do?
|
|
264
|
+
|
|
265
|
+
#### 🎨 Create Complete Themes
|
|
266
|
+
|
|
267
|
+
Simply describe your theme to your AI assistant:
|
|
268
|
+
|
|
269
|
+
> "Create a Material Design dark theme for my Angular app with that takes inspiration from the Gruvbox color scheme."
|
|
270
|
+
|
|
271
|
+
The AI will generate production-ready Sass code with:
|
|
272
|
+
|
|
273
|
+
- Color palette with all shade variations
|
|
274
|
+
- Typography setup with proper type scales
|
|
275
|
+
- Elevation shadows
|
|
276
|
+
- Platform-specific imports and configuration
|
|
277
|
+
|
|
278
|
+
#### 🌈 Generate Color Palettes
|
|
279
|
+
|
|
280
|
+
> "Generate a light theme palette using teal as primary and purple as secondary"
|
|
281
|
+
|
|
282
|
+
Get perfectly calculated color shades following design system standards.
|
|
283
|
+
|
|
284
|
+
#### 📝 Setup Typography
|
|
285
|
+
|
|
286
|
+
> "Set up typography using Inter font with Material Design type scale for Web Components"
|
|
287
|
+
|
|
288
|
+
Get proper typography configuration with font families and responsive type scales.
|
|
289
|
+
|
|
290
|
+
#### 🎯 Customize Components
|
|
291
|
+
|
|
292
|
+
> "What design tokens are available for the button component?"
|
|
293
|
+
>
|
|
294
|
+
> "Create a flat button theme with purple background and white text"
|
|
295
|
+
|
|
296
|
+
Discover and customize individual component styles using design tokens.
|
|
297
|
+
|
|
298
|
+
### Available Capabilities
|
|
299
|
+
|
|
300
|
+
The MCP server provides **8 tools** and **16 resources**:
|
|
301
|
+
|
|
302
|
+
#### Tools (Actions)
|
|
303
|
+
|
|
304
|
+
| Tool | Description |
|
|
305
|
+
| ----------------------------- | --------------------------------------------------------------- |
|
|
306
|
+
| `detect_platform` | Auto-detect which Ignite UI platform your project uses |
|
|
307
|
+
| `create_palette` | Generate color palette with automatic shade calculations |
|
|
308
|
+
| `create_custom_palette` | Create palette with fine-grained control over individual shades |
|
|
309
|
+
| `create_typography` | Setup typography with font families and type scales |
|
|
310
|
+
| `create_elevations` | Configure elevation shadows |
|
|
311
|
+
| `create_theme` | Generate complete theme (palette + typography + elevations) |
|
|
312
|
+
| `get_component_design_tokens` | Discover customizable properties for components |
|
|
313
|
+
| `create_component_theme` | Generate component-specific theme code |
|
|
314
|
+
|
|
315
|
+
#### Resources (Reference Data)
|
|
316
|
+
|
|
317
|
+
- **Platform Information**: Configuration for Angular, Web Components, React, and Blazor
|
|
318
|
+
- **Preset Libraries**: Pre-built palettes, typography, and elevation sets
|
|
319
|
+
- **Color Guidance**: Best practices for color selection and usage
|
|
320
|
+
- **Design System Schemas**: Material, Bootstrap, Fluent, and Indigo configurations
|
|
321
|
+
|
|
322
|
+
### Supported Platforms
|
|
323
|
+
|
|
324
|
+
- **Angular** - `igniteui-angular`
|
|
325
|
+
- **Web Components** - `igniteui-webcomponents`
|
|
326
|
+
- **React** - `igniteui-react`
|
|
327
|
+
- **Blazor** - `igniteui-blazor`
|
|
328
|
+
|
|
329
|
+
### Example Interactions
|
|
330
|
+
|
|
331
|
+
<details>
|
|
332
|
+
<summary><strong>Creating a new project theme</strong></summary>
|
|
333
|
+
|
|
334
|
+
**You**: "I'm starting a new Angular project with Ignite UI. Create a complete Material Design theme with primary blue, secondary coral, light theme, and Roboto font"
|
|
335
|
+
|
|
336
|
+
**AI**: _Uses `create_theme` tool and generates complete Sass code ready to use_
|
|
337
|
+
|
|
338
|
+
</details>
|
|
339
|
+
|
|
340
|
+
<details>
|
|
341
|
+
<summary><strong>Adding dark mode</strong></summary>
|
|
342
|
+
|
|
343
|
+
**You**: "I need a dark mode version with the same primary blue but dark surface"
|
|
344
|
+
|
|
345
|
+
**AI**: _Uses `create_theme` with `variant: "dark"` and generates dark theme code_
|
|
346
|
+
|
|
347
|
+
</details>
|
|
348
|
+
|
|
349
|
+
<details>
|
|
350
|
+
<summary><strong>Customizing components</strong></summary>
|
|
351
|
+
|
|
352
|
+
**You**: "What properties can I customize on the card component?"
|
|
353
|
+
|
|
354
|
+
**AI**: _Uses `get_component_design_tokens` to show available tokens_
|
|
355
|
+
|
|
356
|
+
**You**: "Make the card have a light gray background with subtle shadow"
|
|
357
|
+
|
|
358
|
+
**AI**: _Uses `create_component_theme` to generate component theme code_
|
|
359
|
+
|
|
360
|
+
</details>
|
|
361
|
+
|
|
362
|
+
### Full Documentation
|
|
363
|
+
|
|
364
|
+
For detailed documentation including:
|
|
365
|
+
|
|
366
|
+
- Complete tool parameter reference
|
|
367
|
+
- All prompt examples
|
|
368
|
+
- Platform-specific differences
|
|
369
|
+
- Troubleshooting guide
|
|
370
|
+
- Development instructions
|
|
371
|
+
|
|
372
|
+
See the [MCP Server README](./src/mcp/README.md)
|
|
373
|
+
|
|
374
|
+
### Development Scripts
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
# Build for production
|
|
378
|
+
npm run build:mcp
|
|
379
|
+
|
|
380
|
+
# Debug with MCP Inspector
|
|
381
|
+
npm run mcp:inspector
|
|
382
|
+
|
|
383
|
+
# Run tests
|
|
384
|
+
npm run test
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
## Contributing
|
|
390
|
+
|
|
391
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { ColorDefinition, GrayDefinition, PLATFORMS, ThemeVariant } from '../utils/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Result from generating CSS palette variables.
|
|
4
|
+
*/
|
|
5
|
+
export interface CssPaletteResult {
|
|
6
|
+
css: string;
|
|
7
|
+
description: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Result from generating component theme CSS.
|
|
11
|
+
*/
|
|
12
|
+
export interface CssComponentThemeResult {
|
|
13
|
+
css: string;
|
|
14
|
+
description: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Options for generating standard palette CSS variables.
|
|
18
|
+
*/
|
|
19
|
+
export interface PaletteCssOptions {
|
|
20
|
+
primary: string;
|
|
21
|
+
secondary: string;
|
|
22
|
+
surface: string;
|
|
23
|
+
gray?: string;
|
|
24
|
+
info?: string;
|
|
25
|
+
success?: string;
|
|
26
|
+
warn?: string;
|
|
27
|
+
error?: string;
|
|
28
|
+
variant?: ThemeVariant;
|
|
29
|
+
_loadPaths?: string[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Generate CSS custom properties for a standard palette.
|
|
33
|
+
*
|
|
34
|
+
* This function compiles Sass code that uses the palette() function and
|
|
35
|
+
* @include palette() mixin, then returns the compiled CSS output.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* const result = await generatePaletteCss({
|
|
39
|
+
* primary: '#1976d2',
|
|
40
|
+
* secondary: '#ff9800',
|
|
41
|
+
* surface: '#fafafa',
|
|
42
|
+
* variant: 'light'
|
|
43
|
+
* });
|
|
44
|
+
* // result.css contains :root { --ig-primary-50: ...; --ig-primary-100: ...; ... }
|
|
45
|
+
*/
|
|
46
|
+
export declare function generatePaletteCss(options: PaletteCssOptions): Promise<CssPaletteResult>;
|
|
47
|
+
/**
|
|
48
|
+
* Options for generating custom palette CSS variables.
|
|
49
|
+
*/
|
|
50
|
+
export interface CustomPaletteCssOptions {
|
|
51
|
+
variant?: ThemeVariant;
|
|
52
|
+
surfaceColor?: string;
|
|
53
|
+
colors: {
|
|
54
|
+
primary: ColorDefinition;
|
|
55
|
+
secondary: ColorDefinition;
|
|
56
|
+
surface: ColorDefinition;
|
|
57
|
+
gray: GrayDefinition;
|
|
58
|
+
info: ColorDefinition;
|
|
59
|
+
success: ColorDefinition;
|
|
60
|
+
warn: ColorDefinition;
|
|
61
|
+
error: ColorDefinition;
|
|
62
|
+
};
|
|
63
|
+
_loadPaths?: string[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Generate CSS custom properties for a custom palette.
|
|
67
|
+
*
|
|
68
|
+
* This function generates Sass code for the custom palette structure
|
|
69
|
+
* (using either shades() function or explicit values), compiles it,
|
|
70
|
+
* and returns the CSS output.
|
|
71
|
+
*/
|
|
72
|
+
export declare function generateCustomPaletteCss(options: CustomPaletteCssOptions): Promise<CssPaletteResult>;
|
|
73
|
+
/**
|
|
74
|
+
* Format CSS output for display.
|
|
75
|
+
* Adds a header comment and ensures consistent formatting.
|
|
76
|
+
*/
|
|
77
|
+
export declare function formatCssOutput(css: string, description: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* Options for generating component theme CSS variables.
|
|
80
|
+
*/
|
|
81
|
+
export interface ComponentThemeCssOptions {
|
|
82
|
+
platform: (typeof PLATFORMS)[number];
|
|
83
|
+
/** Design system (defaults to 'material') */
|
|
84
|
+
designSystem?: string;
|
|
85
|
+
/** Theme variant - light or dark (defaults to 'light') */
|
|
86
|
+
variant?: string;
|
|
87
|
+
/** Component name (e.g., "button", "avatar") */
|
|
88
|
+
component: string;
|
|
89
|
+
/** Token name-value pairs */
|
|
90
|
+
tokens: Record<string, string | number>;
|
|
91
|
+
/** CSS selector to scope the theme (optional) */
|
|
92
|
+
selector?: string;
|
|
93
|
+
/** Custom variable name (optional) */
|
|
94
|
+
name?: string;
|
|
95
|
+
/** Internal testing parameter for load paths */
|
|
96
|
+
_loadPaths?: string[];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Generate CSS custom properties for a component theme.
|
|
100
|
+
*
|
|
101
|
+
* This function compiles Sass code that uses the component theme function
|
|
102
|
+
* and @include tokens() mixin, then returns the compiled CSS output.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* const result = await generateComponentThemeCss({
|
|
106
|
+
* platform: 'webcomponents',
|
|
107
|
+
* designSystem: 'bootstrap',
|
|
108
|
+
* variant: 'light',
|
|
109
|
+
* component: 'button',
|
|
110
|
+
* tokens: { background: '#1976d2', 'text-color': 'white' },
|
|
111
|
+
* selector: 'igc-button'
|
|
112
|
+
* });
|
|
113
|
+
* // result.css contains: igc-button { --ig-button-background: var(--ig-button-background, #1976d2); ... }
|
|
114
|
+
*/
|
|
115
|
+
export declare function generateComponentThemeCss(options: ComponentThemeCssOptions): Promise<CssComponentThemeResult>;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import * as path from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import * as sass from "sass-embedded";
|
|
4
|
+
const __filename$1 = fileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname$1 = path.dirname(__filename$1);
|
|
6
|
+
const PACKAGE_ROOT = path.resolve(__dirname$1, "..", "..", "..");
|
|
7
|
+
async function generatePaletteCss(options) {
|
|
8
|
+
const variant = options.variant ?? "light";
|
|
9
|
+
const paletteArgs = [
|
|
10
|
+
`$primary: ${options.primary}`,
|
|
11
|
+
`$secondary: ${options.secondary}`,
|
|
12
|
+
`$surface: ${options.surface}`
|
|
13
|
+
];
|
|
14
|
+
if (options.gray) paletteArgs.push(`$gray: ${options.gray}`);
|
|
15
|
+
if (options.info) paletteArgs.push(`$info: ${options.info}`);
|
|
16
|
+
if (options.success) paletteArgs.push(`$success: ${options.success}`);
|
|
17
|
+
if (options.warn) paletteArgs.push(`$warn: ${options.warn}`);
|
|
18
|
+
if (options.error) paletteArgs.push(`$error: ${options.error}`);
|
|
19
|
+
const sassCode = `
|
|
20
|
+
@use 'sass/color' as *;
|
|
21
|
+
|
|
22
|
+
$palette: palette(
|
|
23
|
+
${paletteArgs.join(",\n ")}
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
@include palette($palette);
|
|
27
|
+
`;
|
|
28
|
+
try {
|
|
29
|
+
const loadPaths = options._loadPaths ?? [PACKAGE_ROOT];
|
|
30
|
+
const result = await sass.compileStringAsync(sassCode, {
|
|
31
|
+
loadPaths,
|
|
32
|
+
style: "expanded"
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
css: result.css,
|
|
36
|
+
description: `Generated CSS custom properties for a ${variant} palette with primary color ${options.primary}`
|
|
37
|
+
};
|
|
38
|
+
} catch (error) {
|
|
39
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
40
|
+
throw new Error(`Failed to compile palette CSS: ${message}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async function generateCustomPaletteCss(options) {
|
|
44
|
+
const variant = options.variant ?? "light";
|
|
45
|
+
const { generateCustomPaletteCode } = await import("../utils/sass.js");
|
|
46
|
+
const paletteLines = generateCustomPaletteCode({
|
|
47
|
+
variant,
|
|
48
|
+
variableName: "custom",
|
|
49
|
+
surfaceColor: options.surfaceColor,
|
|
50
|
+
colors: options.colors
|
|
51
|
+
});
|
|
52
|
+
const sassCode = `
|
|
53
|
+
@use 'sass/color' as *;
|
|
54
|
+
|
|
55
|
+
${paletteLines.join("\n")}
|
|
56
|
+
|
|
57
|
+
@include palette($custom-palette);
|
|
58
|
+
`;
|
|
59
|
+
try {
|
|
60
|
+
const loadPaths = options._loadPaths ?? [PACKAGE_ROOT];
|
|
61
|
+
const result = await sass.compileStringAsync(sassCode, {
|
|
62
|
+
loadPaths,
|
|
63
|
+
style: "expanded"
|
|
64
|
+
});
|
|
65
|
+
return {
|
|
66
|
+
css: result.css,
|
|
67
|
+
description: `Generated CSS custom properties for a custom ${variant} palette`
|
|
68
|
+
};
|
|
69
|
+
} catch (error) {
|
|
70
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
71
|
+
throw new Error(`Failed to compile custom palette CSS: ${message}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function formatCssOutput(css, description) {
|
|
75
|
+
const header = `/* Generated by Ignite UI Theming MCP Server */
|
|
76
|
+
/* ${description} */
|
|
77
|
+
`;
|
|
78
|
+
return header + css;
|
|
79
|
+
}
|
|
80
|
+
async function generateComponentThemeCss(options) {
|
|
81
|
+
const {
|
|
82
|
+
getComponentTheme,
|
|
83
|
+
getComponentSelector,
|
|
84
|
+
getVariablePrefix,
|
|
85
|
+
SCHEMA_PRESETS
|
|
86
|
+
} = await import("../knowledge/index.js");
|
|
87
|
+
const { toVariableName } = await import("../utils/sass.js");
|
|
88
|
+
const theme = getComponentTheme(options.component);
|
|
89
|
+
if (!theme) {
|
|
90
|
+
throw new Error(`Unknown component: ${options.component}`);
|
|
91
|
+
}
|
|
92
|
+
const designSystem = options.designSystem ?? "material";
|
|
93
|
+
const variant = options.variant ?? "light";
|
|
94
|
+
const themeFn = theme.themeFunctionName;
|
|
95
|
+
const themeName = options.name ? `$${toVariableName(options.name)}` : `$custom-${options.component}-theme`;
|
|
96
|
+
const schemaVar = SCHEMA_PRESETS[variant][designSystem];
|
|
97
|
+
const tokenArgs = [`$schema: ${schemaVar}`];
|
|
98
|
+
for (const [tokenName, value] of Object.entries(options.tokens)) {
|
|
99
|
+
const stringValue = typeof value === "number" ? String(value) : value;
|
|
100
|
+
tokenArgs.push(`$${tokenName}: ${stringValue}`);
|
|
101
|
+
}
|
|
102
|
+
const defaultSelectors = getComponentSelector(
|
|
103
|
+
options.component,
|
|
104
|
+
options.platform
|
|
105
|
+
);
|
|
106
|
+
const selector = options.selector || (defaultSelectors.length > 0 ? defaultSelectors[0] : options.component);
|
|
107
|
+
const prefix = getVariablePrefix(options.platform);
|
|
108
|
+
`${prefix}-${options.component}`;
|
|
109
|
+
const sassCode = `
|
|
110
|
+
@use 'sass/themes' as *;
|
|
111
|
+
@use 'sass/themes/schemas' as *;
|
|
112
|
+
|
|
113
|
+
// Custom ${options.component} theme
|
|
114
|
+
${themeName}: ${themeFn}(
|
|
115
|
+
${tokenArgs.join(",\n ")}
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
// Apply the theme to ${selector}
|
|
119
|
+
${selector} {
|
|
120
|
+
@include tokens(${themeName});
|
|
121
|
+
}
|
|
122
|
+
`;
|
|
123
|
+
try {
|
|
124
|
+
const loadPaths = options._loadPaths ?? [PACKAGE_ROOT];
|
|
125
|
+
const result = await sass.compileStringAsync(sassCode, {
|
|
126
|
+
loadPaths,
|
|
127
|
+
style: "expanded"
|
|
128
|
+
});
|
|
129
|
+
return {
|
|
130
|
+
css: result.css,
|
|
131
|
+
description: `Generated CSS custom properties for ${options.component} component with ${Object.keys(options.tokens).length} token(s) using ${designSystem} design system (${variant} variant)`
|
|
132
|
+
};
|
|
133
|
+
} catch (error) {
|
|
134
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
135
|
+
throw new Error(`Failed to compile component theme CSS: ${message}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export {
|
|
139
|
+
formatCssOutput,
|
|
140
|
+
generateComponentThemeCss,
|
|
141
|
+
generateCustomPaletteCss,
|
|
142
|
+
generatePaletteCss
|
|
143
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { CreateElevationsInput, CreatePaletteInput, CreateThemeInput, CreateTypographyInput, DesignSystem, GeneratedCode, Platform, ThemeVariant } from '../utils/types.js';
|
|
2
|
+
export type { ElevationsCodeOptions, PaletteCodeOptions, PaletteCodeResult, TypographyCodeOptions, } from '../utils/sass.js';
|
|
3
|
+
export { generateElevationsCode, generateHeader, generatePaletteCode, generateTypographyCode, generateUseStatement, quoteFontFamily, toVariableName, } from '../utils/sass.js';
|
|
4
|
+
/**
|
|
5
|
+
* Generate a palette definition.
|
|
6
|
+
*/
|
|
7
|
+
export declare function generatePalette(input: CreatePaletteInput): GeneratedCode;
|
|
8
|
+
/**
|
|
9
|
+
* Generate typography setup.
|
|
10
|
+
*/
|
|
11
|
+
export declare function generateTypography(input: CreateTypographyInput): GeneratedCode;
|
|
12
|
+
/**
|
|
13
|
+
* Generate elevations setup.
|
|
14
|
+
*/
|
|
15
|
+
export declare function generateElevations(input: CreateElevationsInput): GeneratedCode;
|
|
16
|
+
/**
|
|
17
|
+
* Generate a complete theme (palette + typography + elevations).
|
|
18
|
+
*
|
|
19
|
+
* Supports two platforms:
|
|
20
|
+
* - `angular`: Uses `igniteui-angular/theming` with `core()` and `theme()` mixins
|
|
21
|
+
* - `webcomponents`: Uses `igniteui-theming` directly with individual mixins
|
|
22
|
+
*
|
|
23
|
+
* If no platform is specified, defaults to generating platform-agnostic code
|
|
24
|
+
* using igniteui-theming directly (similar to webcomponents but simpler).
|
|
25
|
+
*/
|
|
26
|
+
export declare function generateTheme(input: CreateThemeInput): GeneratedCode;
|
|
27
|
+
/**
|
|
28
|
+
* Input for generating a component theme.
|
|
29
|
+
*/
|
|
30
|
+
export interface CreateComponentThemeInput {
|
|
31
|
+
platform: Platform;
|
|
32
|
+
/** Whether to use licensed @infragistics package (Angular only, defaults to false) */
|
|
33
|
+
licensed?: boolean;
|
|
34
|
+
/** Design system (defaults to 'material') */
|
|
35
|
+
designSystem?: DesignSystem;
|
|
36
|
+
/** Theme variant - light or dark (defaults to 'light') */
|
|
37
|
+
variant?: ThemeVariant;
|
|
38
|
+
/** Component name (e.g., "flat-button", "avatar") */
|
|
39
|
+
component: string;
|
|
40
|
+
/** Token name-value pairs */
|
|
41
|
+
tokens: Record<string, string | number>;
|
|
42
|
+
/** Optional CSS selector to scope the theme */
|
|
43
|
+
selector?: string;
|
|
44
|
+
/** Optional custom variable name */
|
|
45
|
+
name?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Generate Sass code for a component theme.
|
|
49
|
+
*/
|
|
50
|
+
export declare function generateComponentTheme(input: CreateComponentThemeInput): GeneratedCode;
|