CSS variables
Every CSS variable, and what it sets.
Chart
Every variable is optional. They can be set on :root, on a class or on a chart. See Styling. Variables that set the same part of a chart start the same way, such as --tablechart-name- for all names.
| Variable | Default | Sets |
|---|---|---|
--tablechart-color |
The text colour | The colour of text and marks |
--tablechart-color-1 |
None | The palette, for donut slices and several lines. The numbers go on: --tablechart-color-2, --tablechart-color-3 and so on |
--tablechart-contrast-wcag |
2 |
How contrast is measured: 2 for the ratio of WCAG 2, 3 for APCA |
--tablechart-font-size |
1em |
All text in a chart. The other sizes are relative to it |
--tablechart-line-height |
1.25 |
The line height of all text in a chart |
--tablechart-margin |
0 |
The space around a chart |
--tablechart-min-height |
200px |
The least height of a chart, on a narrow screen |
--tablechart-max-height |
none |
The most height of a chart, on a wide screen. Above it, a chart only gets wider |
--tablechart-height |
none |
A fixed height, for the minimum and the maximum at once |
--tablechart-surface |
The measured background | The background colour, for lighter lines and slices. Only needed on an image or a gradient |
--tablechart-type |
None | Shows a column chart as a bar chart, or a bar chart as a column chart: bar or column |
Names
A name is the name of a row: under a column, beside a bar or at the end of a line.
| Variable | Default | Sets |
|---|---|---|
--tablechart-name-color |
The text colour | The colour of the names |
--tablechart-name-gap |
0.45em |
The space between the columns and the names under them |
--tablechart-name-max |
40% |
The widest a name beside a bar may be, as a share of the chart’s width. A longer name wraps |
--tablechart-name-padding |
0 0.2em |
The padding of a name under a column |
--tablechart-name-size |
0.95em |
All names |
Values
A value is the number on a bar, column or point.
| Variable | Default | Sets |
|---|---|---|
--tablechart-value-align |
end, center on a waterfall |
Where a number inside its bar goes: start, center or end |
--tablechart-value-color |
The text colour | The numbers on the bars, outside the bars |
--tablechart-value-inside-weight |
inherit |
The weight of the numbers inside the bars |
--tablechart-value-group-size |
--tablechart-value-size |
The numbers of columns or bars side by side |
--tablechart-value-size |
1.3 times the name size | The numbers on the bars |
Bars and columns
| Variable | Default | Sets |
|---|---|---|
--tablechart-bar-color |
The text colour | All bars and a single line |
--tablechart-bar-edge |
None | none leaves out the edge of a column or bar with too little contrast |
--tablechart-bar-edge-width |
1px |
How wide that edge is |
--tablechart-bar-max |
60px |
The widest a bar may be |
--tablechart-bar-radius |
--tablechart-corner-radius |
How round the end of a column or bar is, in px or em |
--tablechart-corner-radius |
0 |
How round the corners of columns, bars and slices are, in px or em |
--tablechart-value-contrast |
5, or 60 with APCA |
The contrast a number inside a bar needs, as in 5:1 or Lc 60. If its colour has less, the number gets to be black or white, to achieve better contrast |
--tablechart-value-on-dark |
The measured background; the text colour on a dark background | The colour of a number on a dark bar |
--tablechart-value-on-light |
The text colour; the measured background on a dark background | The colour of a number on a light bar |
Waterfall
| Variable | Default | Sets |
|---|---|---|
--tablechart-connector-color |
The text colour | The line between two columns |
--tablechart-connector-dash |
2 3 |
The dash pattern of that line, in pixels |
--tablechart-connector-opacity |
0.55 |
The opacity of that line |
--tablechart-connector-width |
1px |
The width of that line |
--tablechart-down-color |
The bar colour | Falling steps |
--tablechart-total-color |
The bar colour | Totals |
--tablechart-up-color |
The bar colour | Rising steps |
Lines and areas
| Variable | Default | Sets |
|---|---|---|
--tablechart-area-color |
The colour of its line | The fill under a line, in an area chart |
--tablechart-area-fade |
0.05 |
The opacity of that fill at the baseline. Stacked areas have no fade |
--tablechart-area-opacity |
0.4, 0.5 when stacked |
The opacity of that fill at the top of the chart |
--tablechart-point-color |
The colour of its line | The points on a line |
--tablechart-series-color |
The bar colour | Lines without a palette. Each next line is lighter |
--tablechart-series-color-end |
None | An end colour: the lines or parts then go from the first colour to this one, in even steps |
--tablechart-series-color-start |
The bar colour | Another name for --tablechart-series-color, to go with the end colour. If both are set, --tablechart-series-color is used |
--tablechart-series-dash |
6 4 |
The pattern of a dashed line, in pixels |
--tablechart-series-dash-dot |
6 4 0 4 |
The pattern of a dash-dot line, in pixels |
--tablechart-series-dot |
0 4 |
The pattern of a dotted line, in pixels |
--tablechart-series-fade |
30% |
How much lighter each next line is |
--tablechart-series-min |
40% |
The lightest a line may be |
--tablechart-series-muted-share |
45% |
How much of its colour a line keeps next to a highlighted line |
--tablechart-series-own-color |
From the palette or the series colour | The colour of one line, set on [data-series="2"] and so on |
--tablechart-series-width |
2px |
The width of a line |
--tablechart-halo-width |
2.5px |
The edge in the background colour around a number of a line that touches a column, so they stand out from a column of a similar colour, and around a number that crosses a line. The line and its points get 60% of it |
Donut
| Variable | Default | Sets |
|---|---|---|
--tablechart-centre-color |
The text colour | The central value of a donut |
--tablechart-centre-size |
1.6em |
The size of that number |
--tablechart-leader-color |
The text colour | The line from a slice to its number |
--tablechart-leader-opacity |
0.45 |
The opacity of that line |
--tablechart-leader-width |
1px |
The width of that line |
--tablechart-slice-color |
The text colour | Slices without a palette. Each next slice is lighter |
--tablechart-slice-color-end |
None | An end colour: the slices then go from the slice colour to this one, in even steps |
--tablechart-slice-color-start |
The text colour | Another name for --tablechart-slice-color, to go with the end colour. If both are set, --tablechart-slice-color is used |
--tablechart-slice-fade |
15% |
How much lighter each next slice is |
--tablechart-slice-gap |
4 |
The gap between slices. It grows with the ring |
--tablechart-slice-radius |
--tablechart-corner-radius |
How round the corners of a slice are, in px or em |
--tablechart-stack-gap |
1px |
The gap between the parts of a stacked column or bar, in the background colour |
--tablechart-slice-min |
20% |
The lightest a slice may be |
Legend
| Variable | Default | Sets |
|---|---|---|
--tablechart-legend-border |
none |
The border of the legend |
--tablechart-legend-focus-color |
The text colour | The focus ring of a name in a legend with toggles |
--tablechart-legend-focus-offset |
2px |
The space between that focus ring and the name |
--tablechart-legend-focus-width |
2px |
How wide that focus ring is |
--tablechart-legend-gap |
0.6em |
The space above the legend |
--tablechart-legend-key-size |
0.7em |
The square before each name in the legend of columns, bars, areas, donuts and pies |
--tablechart-legend-off-opacity |
0.3 |
The sample of a series that is turned off in a legend with toggles |
--tablechart-legend-padding |
0 |
The padding of the legend |
--tablechart-legend-radius |
0 |
The corners of the legend |
--tablechart-legend-surface |
none |
The background of the legend |
Annotations
| Variable | Default | Sets |
|---|---|---|
--tablechart-annotation-color |
The text colour | Annotation lines, arrowheads and badges |
--tablechart-annotation-width |
1.25px |
The width of annotation lines |
--tablechart-badge-border-width |
1px |
The border of the badge |
--tablechart-badge-padding |
0.4em 0.8em |
The padding of the badge |
--tablechart-badge-radius |
0.4em |
The corners of the badge. 50% makes it an ellipse. |
--tablechart-badge-surface |
none |
The background of the badge |
--tablechart-quadrant-color |
The annotation colour | The lines of a quadrant |
--tablechart-quadrant-width |
1.5px |
The width of the lines of a quadrant |
--tablechart-quadrant-dash |
6 4 |
The dashes of the lines of a quadrant, as stroke-dasharray. none makes them solid. |
--tablechart-quadrant-opacity |
0.7 |
How strong the lines of a quadrant are |
--tablechart-quadrant-name-color |
The text colour, lighter | The names in the corners of a quadrant |
--tablechart-quadrant-name-size |
0.85em |
The size of those names |
--tablechart-quadrant-name-weight |
600 |
The weight of those names |
Baseline and scale breaks
| Variable | Default | Sets |
|---|---|---|
--tablechart-baseline-color |
The text colour | The baseline |
--tablechart-baseline-opacity |
0.45 |
The opacity of the baseline |
--tablechart-baseline-width |
1px |
The width of the baseline |
--tablechart-break-color |
The text colour | The lines of a break in the scale |
--tablechart-break-gap |
1.3% of the chart width | The empty space between the two lines of a break |
--tablechart-break-opacity |
1 |
The opacity of those lines |
--tablechart-break-width |
1px |
The width of those lines |
Axes and gridlines
On a scatter chart, and on the other types with data-chart-axis or data-chart-grid. See Axes and gridlines.
| Variable | Default | Sets |
|---|---|---|
--tablechart-axis-color |
The text colour, at 55% | The lines of the axes |
--tablechart-axis-size |
The name size | The numbers and titles along the axes |
--tablechart-axis-text-color |
The text colour | The colour of the numbers and titles along the axes |
--tablechart-axis-width |
1px |
The width of the lines of the axes |
--tablechart-tick-color |
The gridline colour, at --tablechart-tick-opacity |
The colour of the ticks above the names under a line or area chart |
--tablechart-tick-length |
From the baseline to the names | The length of those ticks |
--tablechart-tick-opacity |
0.22 |
How strong those ticks are, if --tablechart-tick-color is not set |
--tablechart-tick-width |
As the gridlines | The width of those ticks |
--tablechart-grid-color |
The text colour | The gridlines, with data-chart-grid |
--tablechart-grid-opacity |
0.09 |
The opacity of the gridlines |
--tablechart-grid-width |
1px |
The width of the gridlines |
Scatter
| Variable | Default | Sets |
|---|---|---|
--tablechart-bubble-max |
24px |
How wide the largest bubble is |
--tablechart-bubble-min |
6px |
How wide the smallest bubble is, so a small value stays visible |
--tablechart-marker-size |
10px |
How wide a marker is, on a chart without a column for the size |
--tablechart-marker-gap |
2px |
The edge in the background colour around a marker, so it stands apart from the lines and markers under it |
--tablechart-marker-ease |
The easing of the chart | How a marker grows as the chart builds, such as an elastic linear() curve |
Candlestick
See Candlestick.
| Variable | Default | Sets |
|---|---|---|
--tablechart-candle-up-color |
--tablechart-up-color |
The colour of a rising candle |
--tablechart-candle-down-color |
--tablechart-down-color |
The colour of a falling candle |
--tablechart-candle-up-fill |
The background | The inside of a rising body, hollow by default |
--tablechart-candle-line-width |
1px |
How thick the wicks and the outlines of the bodies are |
--tablechart-crop-size |
0.85em |
The size of the line under a chart whose first rows are cropped |
--tablechart-crop-color |
The text colour | The colour of that line |
Tooltip
See Styling tooltips. The tooltip reads these from the chart when it opens.
| Variable | Default | Sets |
|---|---|---|
--tablechart-tooltip-border |
A thin line in the text colour | The border of the tooltip |
--tablechart-tooltip-color |
The text colour of the chart | The text colour of the tooltip |
--tablechart-tooltip-padding |
0.45em 0.7em |
The space inside the tooltip |
--tablechart-tooltip-radius |
0.4em |
The corners of the tooltip |
--tablechart-tooltip-shadow |
A shadow, so it stands out | The shadow under the tooltip |
--tablechart-tooltip-surface |
White; in dark mode the background of the chart | The background of the tooltip |
Crosshair
See Crosshair.
| Variable | Default | Sets |
|---|---|---|
--tablechart-crosshair-color |
The text colour, half see-through | The lines of the crosshair |
--tablechart-crosshair-width |
1px |
How thick those lines are |
--tablechart-crosshair-size |
The size of the numbers of the axis, and of the names | The size of the values and the name of the row |
--tablechart-crosshair-radius |
0.25em |
The corners of the values and the name of the row |
--tablechart-crosshair-padding |
0.1em 0.25em |
The space inside the values and the name of the row |
--tablechart-crosshair-border |
1px in the background colour |
The border of the values and the name of the row |
--tablechart-crosshair-name-surface |
The text colour | The background of the name of the row |
--tablechart-crosshair-name-color |
The background colour | The text of the name of the row |
Animation
See Animation.
| Variable | Default | Sets |
|---|---|---|
--tablechart-animation-ease |
ease-in-out |
The easing of bars, donuts, and lines and areas that grow |
--tablechart-animation-element-duration |
0.4s |
How long one bar, column, point or donut slice takes |
--tablechart-animation-max |
2s |
The longest a chart may take to build |
--tablechart-animation-min |
0.5s |
The shortest a chart takes to build |
--tablechart-animation-speed |
1 |
Faster or slower than the defaults of each chart type, as a factor, such as 1.25 |
--tablechart-animation-stagger |
0.25 |
When the next element starts, as a share of the element time |
--tablechart-waterfall-stagger-factor |
2.4 |
How many times the stagger a waterfall has, so it builds column by column |
--tablechart-annotation-duration |
0.6s |
How long an annotation line takes |
--tablechart-queue-duration |
0.4s |
How long a chart in a sequence takes to fade in |