deck brand check <name> validates a brand without rendering a deck. It loads the brand the way every other command does and prints each error and warning with its field and a fix. This page shows how to run the check, read what it prints, and then test the brand on real slides. Use it after you change a brand, and on any brand an agent hands you.
Run the check
$ deck brand check acme
brands/acme/brand.ts
acme: is valid (0 errors, 0 warnings).It exits with 1 when the brand has errors, so it works as a step in a script or CI job. With --json it prints { brand, file, ok, errors, warnings }, plus layoutsFile for a brand with a layouts.ts, and each problem is { path, message, fix, file }, where file is the file the problem is in (layoutsFile and a problem’s file are new in 0.6.0). A brand that doesn’t exist comes back in the same shape, with one error that lists the brands the workspace can use, default among them. This workspace held acme and nocturne:
$ deck brand check nope --json
{
"brand": "nope",
"ok": false,
"file": "brands/nope/brand.ts",
"errors": [
{
"path": "",
"message": "There is no brands/nope/brand.ts.",
"fix": "Use one of: acme, default, nocturne. Or create brands/nope/brand.ts.",
"file": "brands/nope/brand.ts"
}
],
"warnings": []
}Fix a failing brand
These steps break a copy of default (saved as brands/acme/, as in create a brand) on purpose and then fix it.
-
In
brands/acme/brand.ts, lighten the basemutedrole fromink.600toink.400:roles: { bg: 'ink.25', surface: 'ink.50', fg: 'ink.900', muted: 'ink.400', // ... }, -
Run the check.
mutedcarries secondary text, which needs 4.5:1, and it now falls short against bothbgandsurface:$ deck brand check acme brands/acme/brand.ts error color.roles.muted: On the default surface, muted #9aa1ae on bg #fcfcfd has contrast 2.53:1; secondary text needs 4.5:1. Fix: Change muted to a color such as "#6f7582", or change color.roles.bg. error color.roles.muted: On the default surface, muted #9aa1ae on surface #f4f5f8 has contrast 2.38:1; secondary text on cards needs 4.5:1. Fix: Change muted to a color such as "#69707c", or change color.roles.surface. acme: cannot be used (2 errors, 0 warnings).The same errors stop every command that renders with the brand.
deck lint launch-review --brand acmelists them under the brand file and ends withlaunch-review: 2 errors, 0 warnings (2 from the brand). -
Apply the fix. Use a palette step at least as dark as the colour it suggests. Here that’s
ink.600(#555c6a) again, or add the suggested hex to the palette. -
Check again:
$ deck brand check acme brands/acme/brand.ts acme: is valid (0 errors, 0 warnings).
What it checks, in order
The checks run in stages. A stage that finds a problem reports all of its problems, and the later stages don’t run until you fix them. A brand can fail at one stage and then fail again at the next.
- Schema. Types, ranges, required fields and unknown fields. A typo gets the nearest valid name:
"mutd" is not a field of color.roles.withFix: Rename it to "muted". - References. Everything the brand names must exist: palette steps (
"ink.650" refers to a step "650" that the "ink" palette does not have.), gradients, surfaces, logo variants, image treatments, the transition’s easing and duration, font weights a source can supply, contrast waivers, and the node kinds, cards and title families thediagramsection names. Backgrounds must be opaque. - Values CSS can hold. The resolved tokens must be writable as CSS.
- Quality. WCAG contrast of the role pairs on every surface: 4.5:1 for
fgandmutedonbgandsurface, and foraccent-fgonaccent; 3:1 forheading,accent,positiveandnegative. Card colours you write are measured on every surface too: title and subtitle at 4.5:1 on the card’s fill, the icon at 3:1. The data palettes are checked on each surface’s chart plate. Neighbouring categorical colours must stay apart with normal vision and under protanopia, deuteranopia and tritanopia. - Files. The
namematches the folder, font packages are installed in the workspace, and font, logo and background files exist in the brand folder. - Layouts. New in 0.6.0. When the brand has a
layouts.ts, the check prints its path underbrand.tsand checks every layout in it: its name, its fallback, the slots and fields it binds, its boxes and the names it uses. Each problem has its path in the file, such aslayouts[3].regions[2].bind. Brand layouts lists the errors.
Palettes, surfaces and typography explains the roles and surfaces these checks measure.
Layout checks during installation
New in v0.7.0. Brand layout validation changelog.
The importer checks the brand against the layout catalog before writing it to the workspace, including when you pass --force. Run deck brand check <name> to check the installed brand again after local edits. It checks layout names, fallbacks and slot and field bindings. Errors prevent the install and keep the previous brand in place. Warnings name the source file and include a fix.
To fix a layout failure, use the reported field path and fix in the source repository’s layouts.ts, then import the corrected ref. With deck brand add <source> --json, a brand validation failure returns { ok: false, error: { type, message, file, problems } }. For a catalog failure, file points to brands/<name>/layouts.ts. See Brand layouts for what each check means.
Missing Fontsource packages do not block installation: the importer prints commands to install them. An installed package with an unreadable manifest, invalid metadata or missing font files does block installation. Repair or reinstall that package, then retry the import. After adding any missing packages, run deck brand check <name> to check the brand in your workspace.
Diagram cards
The diagram section goes through the same stages. A value outside the schema fails first:
$ deck brand check acme
brands/acme/brand.ts
error diagram.edges.arrow: Expected "triangle" | "open" | "dot", got "chevron".
Fix: Use "triangle", "open" or "dot".
acme: cannot be used (1 error, 0 warnings).Then the names. diagram.kinds takes a node kind itself, not an alias:
$ deck brand check acme
brands/acme/brand.ts
error diagram.kinds.db: There is no node kind named "db".
Fix: Use "database": "db" is another name for it on a node, but `diagram.kinds` takes the kind itself.
acme: cannot be used (1 error, 0 warnings).A surface may recolour only a card the brand has, a title family is one of display, body and mono, and a palette name without a step is not a colour:
$ deck brand check acme
brands/acme/brand.ts
error color.surfaces.inverse.diagram.cards.calout: The inverse surface recolors a card "calout" that the brand does not have.
Fix: Use "callout". Or define "calout" under `diagram.cards`.
error diagram.cards.callout.title.family: There is no family role named "serif".
Fix: Use one of: display, body, mono.
error diagram.cards.callout.accent.color: "amber" names the "amber" palette without a step, so it is not a color.
Fix: Write a step such as "amber.600"; the "amber" palette has 200, 400, 600, 700.
acme: cannot be used (3 errors, 0 warnings).The same stage refuses more than twelve cards, a kinds entry whose card the brand lacks, and two card names whose CSS variables would collide (tint-icon beside tint). Last come the card colours you write, measured on every surface; a fix for a colour that fails on one surface names the place to recolour the card there. Diagram look and cards shows that error and its fix.
Errors and warnings
An error stops the brand from loading. A warning doesn’t, and deck brand check exits 0. Warnings are reported once the brand has no errors left. They cover:
- a contrast pair you waived in
color.waiversthat misses 4.5:1 but reaches 3:1 - neighbouring data colours that are apart, but closer than comfortable
positiveandnegativethat merge under a colour-vision deficiency- a font
substituteof another kind than its family, such as a serif standing in for a sans - a family whose source is
unavailable, which renders in its fallback stack
A waiver goes in color.waivers. It names the pair, a reason that the warning repeats and, optionally, a surface. Without a surface, the waiver applies on every surface. With muted set to ink.500 (4.38:1 on bg):
waivers: [
{ color: 'muted', on: 'bg', reason: 'Secondary text is set at 26px or larger.' },
{ color: 'muted', on: 'surface', reason: 'Secondary text is set at 26px or larger.' },
],$ deck brand check acme
brands/acme/brand.ts
warning color.roles.muted: On the default surface, muted #707786 on bg #fcfcfd has contrast 4.38:1, below 4.5:1 for secondary text; waived: Secondary text is set at 26px or larger.
Fix: Use it only for large text (24px and up), or raise the contrast and drop the waiver.
warning color.roles.muted: On the default surface, muted #707786 on surface #f4f5f8 has contrast 4.12:1, below 4.5:1 for secondary text on cards; waived: Secondary text is set at 26px or larger.
Fix: Use it only for large text (24px and up), or raise the contrast and drop the waiver.
acme: is valid (0 errors, 2 warnings).A waiver only lowers the bar to 3:1. A pair below 3:1 is still an error.
Look at what it resolved
deck brand <name> prints the resolved values: the families, the type scale, the spacing, every role on every surface, in hex, and the diagram look with every card’s colours on the default surface. accent, positive and negative only need 3:1, so small text in those roles uses a text colour held to 4.5:1. When a role reaches only 3:1 on a surface, the summary adds that small-text colour:
$ deck brand default
...
accent (dark): bg #2d4ae0, surface #2439b8, fg #ffffff, heading #ffffff, muted #dde5ff, accent #ffffff, accent-fg #2439b8, border #3f62f5, positive #a5f3fc, negative #ffa98f; small text: negative #ffcbbb
...The output above is cut to the accent surface. deck brand <name> --json prints every token, derived surfaces included.
Check it on slides
A brand can pass every check and still overflow a layout, because its type scale or margins don’t fit. Lint and render real decks in it without editing them:
deck lint launch-review --brand acme
deck shot launch-review --brand acmedeck shot writes to .deck/shots/launch-review@acme/. For a new brand, use a deck with one slide per layout so every layout meets the brand. The import workflow builds one for you. See lint for reading the findings and screenshots for the stills.