Skip to content

theme

Colour tokens for the HTML report shell.

The report is styled through CSS custom properties (--dp-*) that are defined per colour mode in wrapper/assets/style.css. The only tokens that depend on the configuration are the accent shades, derived here from html.style.primary_colors[0] so links, buttons and badges stay readable in both light and dark mode.

Functions:

readable_on(color, background, target=4.5)

Shift color towards black or white until it reaches target contrast on background (WCAG 2.x ratio).

theme_tokens(style)

Template context for the report shell, from html.style.