Themes and contrast
Every diagram comes in four themes. Since types only define an accent, switching theme needs no change to your CSS.
The themes
| Theme | Use |
|---|---|
light | default; secondary texts, arrows and borders keep a contrast of at least 4.5:1 |
dark | dark screens: only the base colours change, tints are recomputed from --c |
print | paper, including black and white: white background, black ink, no shadow, darker fills and thicker strokes. Applied automatically when the HTML output is printed |
auto | HTML only: follows the reader's system setting. PNG and SVG render as light |
Choose with diagram(theme="dark") or, overriding the file, skemo render --theme dark.
Dark
The print theme may change dimensions slightly (thicker borders): the layout is computed for the theme you ask for.
Contrast
skemo lint --contrast diagram.skemo # reports texts below the WCAG threshold
skemo render --contrast high diagram.skemo # darkens (or lightens) those texts, layout unchanged
The threshold is 4.5:1 for text, 3:1 for text on an accent fill and for icons. A custom accent that is too light is reported, with the element and the measured ratio.
Never colour alone
Readers who do not see colours, and printers, still need to tell types apart: give types a --label, and arrows whose
meaning matters a line style (.dashed, .dotted, .thick, .link).
