Home

Web Plotting Theme Target

Overview

In web and HTML outputs, Stencila reads --plot-* CSS variables from :root and builds a plot token bundle that JS renderers consume. Theme updates trigger plot recompilation in the browser.

This translation happens whenever Stencila renders interactive plots in the browser or HTML output, for example:

stencila render report.smd report.html

Token Bundle

The plot token bundle is built in plotTheme.ts and passed to renderer adapters (e.g. Plotly, Vega-Lite, ECharts). If --plot-theme: none is set, renderers keep their defaults.

TokensWeb/JS output
--plot-aspect-ratio, --plot-width, --plot-height, --plot-dpiDimensions and rendering size
--plot-height-min, --plot-height-maxContainer min/max sizing
--plot-color-1 ... --plot-color-12Categorical palette
--plot-shape-1 ... --plot-shape-8Marker shape palette
--plot-line-type-1 ... --plot-line-type-6Line type palette
--plot-ramp-start, --plot-ramp-endSequential color ramp
--plot-background, --plot-panelPlot and panel backgrounds
--plot-panel-borderPanel border toggle
--plot-grid-color, --plot-grid-width, --plot-grid-x-width, --plot-grid-y-widthGrid styling
--plot-text-color, --plot-font-family, --plot-font-size, --plot-title-size, --plot-subtitle-sizeTypography
--plot-padding-*Plot padding
--plot-axis-line-color, --plot-axis-line-width, --plot-axis-title-*Axis styling
--plot-legend-*Legend background, border, text, position
--plot-tooltip-*Tooltip background and text
--plot-point-opacity, --plot-point-size, --plot-line-width, --plot-area-opacityMark styling

Implementation Notes

© 2026 Stencila