CSS
Every mark is an SVG element of the page: select it and style it. toSVG and toPNG keep what your stylesheet changed.
Variables
css
.report {
--nervure-palette: #264653, #e76f51, #2a9d8f;
--nervure-label: #333;
--nervure-muted: #777;
--nervure-grid: #eee;
--nervure-strong: #000;
--nervure-surface: #fff;
--nervure-halo: #fff;
--nervure-font: Inter, sans-serif;
}
@media (prefers-color-scheme: dark) { .report { --nervure-label: #ddd; --nervure-surface: #111; --nervure-halo: #111; } }Call chart.resize() after you change a variable from code. The theme option wins over the stylesheet.
What to select
| Selector | Is |
|---|---|
svg.nervure[data-type="sankey"] | a chart, by type |
[data-part="axes"] | grid, axis labels and titles |
[data-part="series"] | every mark |
[data-part="legend"], [data-part="legend-item"] | the legend |
[data-part="heading"], [data-part="subheading"] | titles in the drawing |
[data-series="Last year"] | the marks of a name |
[data-direction="up"] | candles and bricks that rise |
.nervure-tooltip, .nervure-toolbar | the tooltip and the export menu, in HTML |
.nervure-card, .nervure-card-title | dashboards |