Skip to content

The rest of the colors

Surfaces, ink and accent decide how a deck looks. These two groups decide whether two particular kinds of slide work — a status board and a code listing — and you set them once.

Six colors: three inks and three tinted grounds.

--pass: #2D6A3F; /* the ink */
--warn: #B45309;
--fail: #991B1B;
--pass-bg: … /* a tint of it, behind a badge */
--warn-bg: …
--fail-bg: …

One thing to get right: warn must not look like fail. Amber against red, not two reds. When a slide shows a status board, the difference between “watch this” and “this is broken” is doing real work, and a reader seeing them side by side should never have to squint.

These three inks color the six state marks: --pass fills the check, --warn the dash, --fail the cross. The other three answers — unknown, open and does not apply — all take one gray, --muted-mark, and that is deliberate. They are already told apart by shape (a ring with a ?, an empty ring, a disc with a slash), so a fourth and fifth signal color would add nothing a reader needs, and every extra color is one more thing to keep apart from the other three.

So you set no color for “unknown”. What you do owe: --muted-mark has to clear 3:1 against the page, because a ring or a slash is a shape, not text, and the 3:1 floor for graphics is what applies to it.

The heat modifier swaps --pass and --fail on the marks, for slides read as risk. It borrows your two inks rather than adding any, so it needs nothing from the theme either.

Twelve colors for the parts of a code block: comments, keywords, strings, numbers, function names, and so on.

--code-text: #E6EDF6; /* everything the twelve below do not claim */
--syntax-comment: #8B9FB8; /* comments and quotes */
--syntax-keyword: #F0A6C0; /* function, const, return */
--syntax-string: #93D3A8; /* string and regex literals */
--syntax-number: #F2C88B; /* numeric literals */
--syntax-constant: #F2C88B; /* true, false, null */
--syntax-builtin: #8FD3E8; /* built-in names */
--syntax-entity: #8CB8F0; /* the names of functions and classes */
--syntax-type: #C4AEF0; /* type names, symbols, meta */
--syntax-variable: #E8DDB5; /* variables, attributes, bullets */
--syntax-parameter: #DCE3EC; /* a parameter list */
--syntax-markup: #F0A6C0; /* markup tags and attribute names */
--syntax-punctuation: #AAB8C9; /* braces, operators */

Two things constrain them. They all sit on --code-bg — the panel behind the block, which defaults to --surface-inverse — and every one of them is small text a person reads, so each has to be genuinely legible against that background. The values above clear 4.5:1 on #0A1628, comments and punctuation included.

The temptation to make comments nearly invisible is exactly the mistake: de-emphasis is about where a color sits relative to the code around it, not about whether it can be read at all. --syntax-comment is the quietest color in the block above and still clears the floor with room to spare.

The code colors you never set

Try this. This theme sets none of the twelve, so the code block is wearing the engine's defaults. Paste --syntax-comment: #8B9FB8; into the :root block and watch just the comment line move — then --syntax-keyword: #F0A6C0; and function, const and return follow.

The lab above renders a complete code slide from a theme that never mentions code, because the engine carries a default for every color on this page. That is good while you work and a bad way to ship: a theme that stops at the colors on these two pages is, in every group it skipped, quietly wearing somebody else’s.

One family has no default at all. The twelve categorical pairs fall through to nothing rather than to a fallback, so a theme that omits them does not draw its charts in the wrong colors — it draws them in none, and a flowchart comes out as four identical boxes with unreadable labels. That is why the contract requires all twenty-four values, and why Colors for charts and diagrams is the one group with a page to itself.

Ship your theme lists the full 98, and a finished theme shows the hand-written half whole.

Colors are only half the job. The other half is whether anyone can read them: Contrast and readability.