Rebrand a generated TimeWarp.Architecture app. The visual brand (product name, logo, icons, manifest colors, Fluent seed, role colors and their dark variants) is one BrandOptions section in web-server configuration plus image files; the assistant name is the only runtime (admin) brand setting; no shell code is edited. Use when changing an app's name, logo, colors, favicon, PWA icons, or link-preview image, when adding component CSS that needs a brand color, or when /brand.css, /manifest.json, or /brand.json look wrong.
Maintained in timewarp-architecture · Canonical file: SKILL.md
Install
With TimeWarp.Skills:
dnx TimeWarp.Skills -- add tw-brand https://timewarp.software/
Add a harness target and skills sync (see the TimeWarp.Skills page). Or copy the SKILL.md into your agent's skills directory.
Brand (configuration only)
Rule. The app's agent sets the visual brand once, in configuration: the BrandOptions
section of source/container-apps/web/projects/web-server/appsettings.json, plus the image files
it names. Identity words an admin changes at runtime (the assistant name on the AI page) are
not configuration. Nothing in a rebrand edits shell code (.razor, .razor.css, tokens.css,
App.razor).
Where the brand comes from
| Surface | Source |
|---|---|
<title>, home heading, Brand card |
BrandOptions.ProductName |
| App-bar and focused-page logo | LogoSrc, LogoAlt (empty = ProductName), LogoWidth, LogoHeight |
| Fluent component ramp | SeedColor, ExactRamp (written to body[data-theme-color] and Fluent's theme storage) |
Shell colors (/brand.css) |
Tokens: role colors and their dark variants |
| Tab icon, iOS icon | FaviconSrc, AppleTouchIconSrc (the <link> tags in App.razor) |
PWA manifest (/manifest.json, served) |
ProductName, ThemeColor (empty = seed), BackgroundColor (empty = #fafafb), Icon192Src, Icon512Src |
| Open Graph / Twitter image | OgImageSrc; SiteMetadata.SiteName, Title, ImageAlt default to the name and logo alt |
| SPA after hydration | GET /brand.json (the same section; the SPA has no copy) |
| Assistant name | Runtime admin setting (AI page, UpdateAssistantName). Not configuration. |
Paths are relative (images/brand/logo.svg), root-relative (/images/logo.svg), or absolute
https:// URLs. The validator rejects anything else at startup, and every color must be
#RGB or #RRGGBB.
Role tokens
Component CSS reads role tokens only. /brand.css overrides exactly these, so anything else
keeps the template color after a rebrand.
BrandOptions:Tokens key |
CSS custom property | Use |
|---|---|---|
Primary, PrimaryHover, PrimaryActive |
--twe-primary, -hover, -active |
Header frame, primary fills, selected states |
PrimarySoft |
--twe-primary-soft |
Light primary tint, gradients |
OnPrimary |
--twe-on-primary |
Text on a primary fill |
Secondary, SecondaryHover, SecondaryActive |
--twe-secondary, -hover, -active |
Footer frame, links, focus outlines |
SecondaryBright |
--twe-secondary-bright |
Bright secondary step, gradients |
Highlight, HighlightSoft |
--twe-highlight, --twe-highlight-soft |
Accent rules, active status dot |
Info |
--twe-info |
Info status color |
PrimaryDark |
--twe-primary-text in dark mode |
Primary text, accent text, focus ring on dark paper |
SecondaryDark |
--twe-secondary-text in dark mode |
Links and info text on dark paper |
HighlightDark |
--twe-highlight-text in dark mode |
Shell accent rules on dark paper |
tokens.css keeps a hue palette (--twe-purple*, --twe-blue*, --twe-green*). It only seeds
the role defaults. A var(--twe-purple…), var(--twe-blue…), or var(--twe-green…) under
features/ or components/ fails BrandRoleTokens_Should_. Text on paper uses the derived
roles (--twe-link, --twe-primary-text, --twe-accent-text, --twe-focus-ring); see
tw-blazor-css-strategy.
Rebrand steps
Pick the colors. Seed = the brand's main color; it is usually
Primarytoo.PrimaryHover: about 10% lighter thanPrimary.PrimaryActive: about 25% darker.PrimarySoft: a pale tint. Same pattern for secondary;SecondaryBrightis a vivid step.OnPrimarymust reach 4.5:1 onPrimary.- Dark variants: start from the soft or bright step and lighten until it reaches 4.5:1 on
#303030forPrimaryDarkandSecondaryDark(text), 3:1 forHighlightDark(an indicator). Check each pair with a contrast checker before committing.
Make the images from one square SVG mark (
mark.svg) and one horizontal lockup (logo.svg). Withrsvg-convert(librsvg) and ImageMagick:cd source/container-apps/web/projects/web-spa/wwwroot mkdir -p images/brand cp ~/brand/logo.svg images/brand/logo.svg cp ~/brand/mark.svg images/brand/favicon.svg # modern browsers take an SVG icon rsvg-convert -w 32 -h 32 ~/brand/mark.svg -o favicon-32x32.png rsvg-convert -w 180 -h 180 -b white ~/brand/mark.svg -o apple-touch-icon.png rsvg-convert -w 192 -h 192 ~/brand/mark.svg -o icon-192.png rsvg-convert -w 512 -h 512 ~/brand/mark.svg -o icon-512.png rsvg-convert -h 200 ~/brand/logo.svg -o /tmp/logo.png magick -size 1200x630 xc:'#ffffff' /tmp/logo.png -gravity center -composite images/og-image.pngOverwriting the default icon paths needs no key change. New paths need the matching key.
Set the section in
web-server/appsettings.json(keys you omit keep the defaults):"BrandOptions": { "ProductName": "Northwind Traders", "LogoSrc": "images/brand/logo.svg", "LogoWidth": 180, "LogoHeight": 40, "SeedColor": "#0b6e4f", "ExactRamp": false, "FaviconSrc": "images/brand/favicon.svg", "Tokens": { "Primary": "#0b6e4f", "PrimaryHover": "#11865f", "PrimaryActive": "#06492f", "PrimarySoft": "#a7e3c8", "OnPrimary": "#ffffff", "Secondary": "#c2571a", "SecondaryHover": "#d86a2b", "SecondaryActive": "#8a3a0d", "SecondaryBright": "#ff9a52", "Highlight": "#d4a017", "HighlightSoft": "#f7e3a1", "Info": "#1f6fb2", "PrimaryDark": "#7fd8b0", "SecondaryDark": "#ffb27d", "HighlightDark": "#f2c94c" } }Per-environment values (a staging color) go in
appsettings.<Environment>.jsonor environment variables (BrandOptions__SeedColor). The SPA reads whatever the server bound.Delete the template logo
wwwroot/images/timewarp-horizontal.svgonceLogoSrcpoints elsewhere.Copy that is not brand configuration. Review and rewrite as product copy:
SiteMetadata:Description(link previews),WebAuthnOptions:RpName(passkey prompts), and the agent documents inwwwroot(index.md,llms.txt,auth.md,.well-known/agent.json,.well-known/agent-card.json,.well-known/mcp.json). IfIcon192Srcmoves, update theiriconUrl.
Verify
dev build, then run the app (dev run) and check:/brand.cssshows the:rootroles and abody[data-theme="dark"]block with the three dark variants;/manifest.jsonshows the name, colors, and icons;/brand.jsonshows the section.- The header, the tab icon, and
/DesignSystem(Brand and Color Tokens cards), in light and dark mode (theme button in the app bar).
No template mark is left in the brand surfaces:
rg -n -i 'timewarp|#55409c' source/container-apps/web/projects/web-spa/wwwroot \ source/container-apps/web/projects/web-server/components/App.razorHits that name a TimeWarp library (
TimeWarp.State,TimeWarp.Identity,timewarp-identity,x-timewarp-*), a code identifier (TimeWarpPage), or atokens.csshue palette line are dependencies, not brand.dev template-smokeruns this check on a generated app.
Do not
- Do not edit
tokens.css,.razor.css, orApp.razorto change a brand color, icon, or name. - Do not read a hue palette token in component CSS. Add a role token instead (a
BrandTokenOptionsproperty, its--twe-*declaration intokens.css, and its line inBrandStylesheet.Render). - Do not add a
BrandOptionssection toweb-spa/wwwroot/appsettings.json. The server is the one source; the SPA loads/brand.json. - Do not make a brand value a
dotnet newparameter.sourceNamerenames the product; the rest is configuration.
Code
web-spa/configuration/: BrandOptions, BrandTokenOptions, BrandOptionsValidator,
BrandStylesheet (/brand.css), BrandDocument (/brand.json and the SPA loader),
WebManifest (/manifest.json), BrandThemeScript. web-server/brand-endpoints.cs maps the
three documents. Tests: BrandOptions_Should_, BrandRoleTokens_Should_
(web-spa-integration-tests), Serve_Given_A_Rebranded_Host_ (web-server-integration-tests).