--- name: migrate-design-prototype description: "Reproduce a Claude Design prototype or design handoff (HTML/CSS, .dc.html export, tokens, screenshots) inside a Mendix app: build the palette with `mxcli theme create --from`, then apply classes in pages with MDL. Use when given a design artefact and asked to make the app look like it." --- # Migrate a Claude Design Prototype into a Mendix App (Theme + Pages) ## When to Use This Skill Use this skill when you are given a **Claude Design prototype / design handoff** (an HTML/CSS prototype, a `*.dc.html` design-console export, a tokens file, a PRD, and/or screenshots) and need to reproduce that look in a Mendix app using **mxcli + MDL**. It covers the two halves of the job: 1. **Build the SCSS theme** — turn the prototype's design language (colours, fonts, spacing, component styles) into a Mendix theme in `theme/web/main.scss`. 2. **Apply it in pages** — attach the theme's classes to widgets with MDL (`Class:` / `DynamicClasses:` on `create page` / `alter page`). Related skills: **`atlas-design` (read first — the Atlas-first taste + workflow layer)**, `theme-styling` (SCSS compilation chain, hot-reload, styling caveats), `create-page` (widget syntax), `alter-page` (in-place widget edits), `bulk-widget-updates` (apply a class across many widgets). --- ## The Pipeline at a Glance ``` Claude Design handoff Mendix app ───────────────────── ────────────────────────────── *.dc.html / prototype ──① theme ──► mxcli theme create --from tokens / CSS / PRD create → a theme the project owns │ component styles ──② rebuild ──► Atlas block / utility class, and only (cards, chips, …) as classes then .ss-* classes in main.scss │ screenshots ──③ reference ──► widgets get Class: / DynamicClasses: (per screen) per screen via create page / alter page │ ──④ build ──► docker build → docker reload --css │ ──⑤ verify ──► compare running screen to screenshot ``` **Golden rule:** the prototype is the source of truth. Before building or polishing any screen, open the matching screenshot/handoff for that screen and match it — colours, spacing, font, component shapes. Do not invent styling the prototype doesn't show. **Atlas-first (read `atlas-design`).** Reproduce the prototype with what Atlas already gives you *before* hand-writing custom SCSS. In order of preference: 1. **An Atlas building block** — `use building block Atlas_Web_Content.Card` / `Pageheader` / `List_Cards` etc. gives you the whole component's markup + styling for free. Discover with `list building blocks`, inspect with `describe building block`. 2. **Atlas utility classes and typed design properties** — `class:'card'`, `class:'btn btn-primary'`, `spacing-inner-*`/`spacing-outer-*` for padding/margin, `flex-row`/`flex-column` + `align-x-*`/`align-y-*` for layout (no `layoutgrid` needed); or the typed equivalents `designproperties: ('Card style': on)`, `['Background color': 'Brand Primary']`, `['Spacing': ['margin-bottom': 'L']]`. `mxcli check -p` validates design-property keys and values (MDL-WIDGET11/12) and lists the allowed values. 3. **Brand-token retune** — build the palette with `mxcli theme create --from` (step ①). The theme maps ~60 Atlas variables onto it, so the whole app inherits the look; hand-mapping a handful of `--brand-*` leaves most of Atlas on stock blue. 4. **Custom `.ss-*` SCSS — for brand identity only.** Reach for a hand-rolled component class (below) only when Atlas genuinely can't express the shape (bespoke chrome, fractional-track grids, pixel-exact rows). Hand-rolling `.panel`/`.stat`/`.card` SCSS that just re-implements what `class:'card'` already does is the single most common mistake — see `atlas-design`. The rest of this skill (custom SCSS components, `.ss-*` classes, ListView row reshaping) is **layer 4** — the identity layer you drop to when the first three don't reach the design. --- ## Where the Theme Lives (read this first — it avoids the main friction) - **Custom styles go in `theme/web/main.scss` AFTER the `@import`s, or in your own partial.** Styles placed after the imports win the cascade over Atlas defaults. Once `main.scss` grows, prefer splitting a partial out for readability: create `theme/web/_.scss` and add `@import "";` after the Atlas imports (the same cascade-order rule then applies within the partial). New partials **are** creatable — keep the import order (custom after Atlas) and everything works. - Use a **project prefix** for every custom class so it never collides with Atlas or widget CSS — `.ss-panel`, `.ss-chip`. Pick one and use it everywhere. Do **not** invent a parallel set of `--ss-*` colour variables: the theme's `--mxt-*` palette is already the app's vocabulary, and a second one silently stops following a theme or variant swap. - `theme/web/custom-variables.scss` holds the **palette**, and `mxcli theme apply` writes it — it is a generated, digest-fenced block. Retune tokens there for a one-value tweak; for a real brand, own the theme (`mxcli theme create`, step ①) rather than editing inside the fence, which the next `apply` refuses. - `theme/mxcli-themes//` is where a theme the project owns lives. Committed, and **not compiled** — mxbuild's entry point is `theme/web/main.scss` and it does not glob `theme/`, so the sources sit inert until `theme apply` copies them into `theme/web/`. - Do **not** hand-edit `theme-cache/web/` — that is the compiled build artifact. --- ## ① Build the Theme — `mxcli theme create --from` **Do not hand-write a token block.** A theme's palette is nothing but `--mxt-*` custom properties, and mxcli builds one from a design artifact directly: ```bash mxcli theme create acme -p app.mpr --from design/canvas.dc.html mxcli theme apply acme -p app.mpr ``` `--from` reads `--mxt-*` declarations out of any CSS-shaped text — a stylesheet, an SCSS partial, or the `