Skip to content
MyAppBuilder
StableReference

Theme tokens reference

Every theme setting is a token : a dotted path such as colors.primary with a value. The Theme view, presets and the AI all change the theme by setting tokens, one set theme token command per token. This page lists every token, its allowed values and its default.

Every theme setting is a token: a dotted path such as colors.primary with a value. The Theme view, presets and the AI all change the theme by setting tokens, one set_theme_token command per token. This page lists every token, its allowed values and its default.

Colors

TokenDefaultAccepted values
colors.primary#6055d9Hex color
colors.secondary#0f9d8aHex color
colors.background#f7f8fcHex color
colors.surface#ffffffHex color
colors.text#222638Hex color
colors.muted#788092Hex color
colors.border#e5e7efHex color
colors.success#2f9e6eHex color
colors.warning#c98a1bHex color
colors.danger#d14b62Hex color

Typography

TokenDefaultAccepted values
typography.fontFamilyInter, 'Segoe UI', Arial, sans-serifCSS font stack, up to 120 characters
typography.headingFontFamilyInter, 'Segoe UI', Arial, sans-serifCSS font stack, up to 120 characters
typography.baseSize14Number 10–24 (the Theme slider offers 12–18)
typography.scale1.2Number 1–1.6 (the Theme list offers 1.125, 1.2, 1.25, 1.333)

Spacing and shape

TokenDefaultAccepted values
spacing.unit4Number 2–16
spacing.densitycomfortablecompact, comfortable, spacious
radii.sm6Number 0–40
radii.md10Number 0–40
radii.lg14Number 0–60
shadows.intensity1Integer 0–3 (None, Soft, Medium, Strong)

Component styles

TokenDefaultAccepted values
componentStyles.buttonsolidsolid, soft, outline
componentStyles.inputoutlineoutline, filled, underline
componentStyles.cardborderedbordered, elevated, flat
componentStyles.tablelineslines, striped, plain
componentStyles.navtoptop, sidebar, none

Brand assets and fonts

TokenDefaultAccepted values
logoAssetIdnoneId of an uploaded image asset, or null to remove
faviconAssetIdnoneId of an uploaded image asset, or null to remove
customFontsnoneList of { family, assetId } entries
modenonelight or dark (reserved; apps render the light theme today)

How tokens become styles

Example
Theme token               CSS variable            Used by
colors.primary        ->  --mab-primary           buttons, links, focus rings
                          --mab-primary-ink       text on primary (auto)
                          --mab-primary-soft      soft buttons, highlights (auto tint)
typography.baseSize   ->  --mab-text-base         body text
                          --mab-h1 … --mab-h4     headings (base × scale^n)
radii.md              ->  --mab-radius            cards, inputs, buttons
spacing.density       ->  --mab-gap, --mab-pad    grid gaps, card padding
shadows.intensity     ->  --mab-shadow-sm/md/lg   menus, dialogs, elevated cards

Setting tokens with the AI

The AI's set_theme_token operation takes { token, value }. The AI rules list these tokens as supported: colors.primary, colors.secondary, colors.background, colors.surface, colors.text, typography.fontFamily, radii.md, spacing.density, componentStyles.button, componentStyles.card, componentStyles.nav. Without an AI key, the local planner recognises colors ("change the accent color to #2563eb"), density ("more compact", "more spacious"), corners ("rounded corners", "square corners") and "sidebar navigation".

Common mistakes

  • A value outside the range. The command is rejected and nothing changes; for example shadows.intensity 4 or radii.lg 80.
  • Setting radii.md alone and expecting small and large to follow. Only the Theme slider derives the other two; a direct token change sets one radius.
  • Expecting mode: dark to switch the app to dark mode. The token exists for the future; dark mode is not available yet.

Advanced

Tokens are validated by the theme schema (ThemeSchema) on every transaction, and set_theme_token uses path (not token) in its command payload. resetTokens() computes the tokens that differ from DEFAULT_THEME and sets them back in one transaction, excluding logoAssetId, faviconAssetId and customFonts. The full command reference is at Builder commands.

Related

Was this helpful?