10.5 Light and dark themes, contrast and accessibility
The report uses semantic CSS tokens for surfaces, panels, text and data series. It can follow the system prefers-color-scheme setting and can also respond to an explicit data-theme override. The purpose is not decorative variation: a theme-aware report should preserve hierarchy and series meaning in different viewing conditions.
Figure 10.3. Surface and ink colors adapt to the display theme while the blue and orange series retain their identities.
Semantic colors
Current report styling uses a blue first series, orange second series and green third series, with theme-adjusted variants on dark surfaces. VPC plotting also assigns stable roles to median, outer interval, observations, points outside bands and reference lines. Stable roles let a reviewer learn the grammar once; arbitrary per-figure color changes make comparisons harder.
Color must not carry the full meaning. A median line, observation point and reference line should remain distinguishable through geometry, labels, line style, point shape or legend text. This also protects grayscale printing and readers with color-vision differences.
Contrast is contextual
Contrast must be checked for small text, thin axes, grid lines, uncertainty ribbons and points—not only headings. A pale interval ribbon can be visually pleasing yet disappear in a projector image or photocopy. Conversely, a saturated dark-mode palette may produce muddy colors when printed by software that forces a white background.
The publication theme uses a white panel rather than relying on web dark mode. This is appropriate for journals and document editors, where a stable background and predictable ink are more important than matching the viewer's operating-system preference.
Accessible text and interaction
Meaningful headings, captions, table headers and native SVG titles help navigation. A figure caption should state what the figure establishes, not simply repeat the title. Hover text can expose values but is supplementary because it is not available to keyboard-only, touch or print workflows in the same way.
| Review | Light mode | Dark mode | Print/grayscale |
|---|---|---|---|
| Text | Ink on white/pale surface | Pale ink on navy surface | Black or dark ink on white |
| Series | Distinct hue and geometry | Theme-adjusted hue and geometry | Geometry/line style still distinct |
| Warnings | Visible without relying on red alone | Sufficient luminance contrast | Label and symbol remain |
| Ribbons | Do not obscure points | Do not merge with panel | Survive grayscale conversion |
Common mistakes
- Checking only one operating-system theme.
- Using red/green alone for pass/fail status.
- Assuming a screen-visible ribbon will remain visible in print.
- Putting essential values only in hover text.
Checklist
- Inspect every report in light, dark and print preview.
- Confirm line styles, shapes and labels preserve series identity.
- Test representative pages in grayscale.
- Write informative alt text/captions for explanatory figures.
Further reading
See HTML anatomy, chart design and publication QC.