Themes

Complete themes

  • theme-bw - Black-and-white theme: white panel, black axes, light grey grid.
  • theme-classic - Classic theme: white panel, axis borders, no gridlines.
  • theme-dark - Dark theme: dark grey panel, white grid, dark axis text.
  • theme-grey - Grey theme: light grey panel with white gridlines.
  • theme-light - Light theme: light grey panel, white grid, soft grey axes.
  • theme-linedraw - Linedraw theme: white panel, strong black axes, very faint grid.
  • theme-minimal - Minimal theme: white panel, light grey gridlines, no axis lines.
  • theme-void - Void theme: no axes, no grid, no panel background.

Modify a theme

  • theme - Build a custom theme from per-element overrides.
  • theme-get - Get the current global default theme.
  • theme-set - Set the global default theme for all subsequent plots.

Sub-theme accessors

Theme elements

  • element-blank - Blank element: hides the corresponding theme element.
  • element-geom - Layer-default aesthetics shared across geoms.
  • element-line - Line element: colour and stroke thickness.
  • element-rect - Rectangle element: fill, outline colour, stroke thickness, and per-side margins. inset is honoured on plot-background (Typst block(inset:) pads the content inward, and grows the painted fill outward past it when a fill or stroke is set) and on legend-background (grows the legend rect outward from the guide-stack bbox so the rectangle frames the legend with extra inner padding). panel-background and legend-bar ignore inset so the rect cannot bleed onto neighbours. outset reserves outer whitespace by widening the chrome slot on panel-background, legend-background, and legend-bar; on plot-background it wraps the rendered block in pad(...). On legend-background, the panel-facing outset side also widens the visible gap between panel and legend. On plot-background, both inset and outset apply whether or not a fill or stroke is set, so they reserve plot padding on their own. strip-background ignores both fields – the facet band has no surrounding slot to grow or reserve into.
  • element-text - Text element: font size, weight, colour, and angle.
  • element-typst - Typst-markup text element: same fields as element-text plus automatic Typst-markup evaluation for plain strings reaching this surface.
  • margin - Per-side spacing record consumed by element-text / element-typst (text margin to neighbours) and element-rect (inset / outset offsets around the painted rectangle).
Back to top