Skip to content

Reference

Style contract

Every custom property and class the dashboard runtime styles, which your page's own CSS can set or target to restyle every widget.

The runtime draws a widget wherever your page marks an element with data-dash (the roles are in Runtime attributes), and it styles what it draws with stylesheets of its own. This page is everything those stylesheets expose to your CSS: the custom properties they read, the classes they style, and the states they key on.

A check in CI reads this page against the runtime and fails when a token here is not defined, when the runtime defines or styles something this page does not list, or when a class listed here is renamed. So the lists below are complete.

Your CSS outranks the runtime's

Every stylesheet the runtime injects sits in one cascade layer, drt, which it declares first in <head>. A rule you write outside any layer outranks every layer, and a layer of your own is declared after drt, so it outranks it too. Your CSS beats every runtime rule, whatever its specificity or position, with no !important. The runtime writes no !important of its own. The one thing a rule of yours beats only with !important is an inline style, and the few colours the runtime writes inline are under What no token or class reaches.

Two ways to restyle, and both work:

  • Set the tokens on your :root. Every colour and every font the runtime's stylesheets use comes from them.
  • Write rules against the classes. .drt-table td { padding: 4px 8px; } changes every table's cell padding.

A generic rule reaches the widgets too

A rule such as svg text { ... }, table td { ... } or button { ... } wins over the runtime's class rules, so it restyles every widget as well as your own markup. If you mean it for your own markup only, scope it: .my-chart svg text, not svg text.

Two older-browser cases, which draw the defaults rather than your tokens:

  • No cascade layers (Chrome before 99, Firefox before 97, Safari before 15.4): the runtime's stylesheets go in unlayered, as they did before layers, and there only !important beats them.
  • No color-mix() (Chrome before 111, Firefox before 113, Safari before 16.2): focus rings, shadows, the detail dialog's backdrop and the fill under an area chart keep their default colours, whatever tokens you set.

Tokens

Set them on :root. A default is what the runtime draws when your page sets nothing, so set every one, and nothing is left at a default by omission.

Accent

TokenDefaultWhat it paints
--drt-blue#2563ebBars, lines, points, gauge fills, focus borders and the pending bar, and, mixed with transparency, every focus ring and the fill under an area chart.
--drt-blue-700#1d4ed8A bar or mark on hover, the View detail button on hover, and the selected mark of a cross-filter.
--drt-blue-soft#eff6ffNothing the runtime draws. Defined for your own CSS.
--drt-accentcurrentColorThe drill-down's breadcrumb links, and a row's descend control on hover. The default is the surrounding text colour.
--drt-on-blue#fffText and marks drawn on the accent: the treemap's labels and the check mark in a selected option.

Text

TokenDefaultWhat it paints
--drt-ink#0f172aPrimary text (table cells, figures, dialog text), a waterfall's total and a gauge's target.
--drt-muted#475569Nothing the runtime draws. Defined for your own CSS.
--drt-subtle#64748bLabels, captions, legends, the notes under a widget, and a waterfall's decreases. It is held to 4.5:1 contrast, because those notes are text a viewer has to read.
--drt-faint#94a3b8Axis numbers, separators, disabled controls and control borders on hover.

Surfaces and lines

TokenDefaultWhat it paints
--drt-surface#fffCard, control, table and dialog backgrounds, and the hairlines between scatter points and treemap rectangles.
--drt-sunken#f8fafcTable headers, row hover, totals rows and pressed controls.
--drt-line#e2e8f0Hairline borders, and every loading placeholder except a chart's.
--drt-line-strong#cbd5e1Control borders, chart baselines and totals rules.
--drt-grid#eef2f6Chart gridlines, table row rules, gauge tracks and the chart's loading placeholder.
--drt-shadow#0f172aThe colour every shadow and the detail dialog's backdrop are mixed from. It is not --drt-ink, so a dark page can lighten its text and keep dark shadows.

Type and motion

TokenDefaultWhat it paints
--drt-sans'Inter',ui-sans-serif,system-ui,-apple-system,sans-serifAll prose and labels, including the notices on a page with page code.
--drt-monoui-monospace,'JetBrains Mono','SF Mono',Menlo,monospaceEvery figure, with tabular numerals.
--drt-easeeaseThe timing of the runtime's transitions and entrance animations. The loading pulses and the pending bar keep their own.
--drt-chevronin the full token block: a 16px chevron stroked in #64748bThe arrow on the filter, date-range, sort and top-N dropdowns (.drt-select). It is an image, because CSS cannot recolour one: to change its colour, set it to your own url("data:image/svg+xml;...").

Series

Five slots for the series of a multi-series chart and the slices of a pie or donut. Each default clears 3:1 on white, the bar a mark has to clear, and the set is colourblind-checked as a group. Five is also the ceiling on slices, because a slice's identity is its colour.

TokenDefaultWhat it paints
--drt-series0#2563ebThe first series or slice. The same blue as --drt-blue, so set both.
--drt-series1#0d9488The second.
--drt-series2#d97706The third.
--drt-series3#db2777The fourth.
--drt-series4#65a30dThe fifth.

Notices on a page with page code

The runtime draws these only on a page whose own script calls dashies.data.

TokenDefaultWhat it paints
--drt-warn-ink#7c2d12The text of the notice that says a result is partial.
--drt-warn-soft#fff7edIts background.
--drt-warn-line#fed7aaIts border.
--drt-error-ink#991b1bThe text of the notice that says one of the page's own callbacks threw.
--drt-error-soft#fef2f2Its background.
--drt-error-line#fecacaIts border.

Status bars

The bars fixed to the bottom of a page: the date a dashboard's data is from, when a refresh could not bring in more, and the note on an archived version's preview. They follow the viewer's colour scheme, so their three colours are the only tokens with a dark default, which applies under prefers-color-scheme: dark. A value you set applies in both schemes.

TokenDefaultWhat it paints
--drt-status-ink#334155, dark #cbd5e1The bar's text.
--drt-status-soft#f1f5f9, dark #1e293bIts background.
--drt-status-line#cbd5e1, dark #334155Its top border.
--drt-status-fontsystem-ui,-apple-system,"Segoe UI",Roboto,sans-serifIts text, which is the viewer's system face by default rather than --drt-sans.

The full token block

Every token at its default. Copy it into your page's <style> and change the values.

:root {
  --drt-blue: #2563eb;
  --drt-blue-700: #1d4ed8;
  --drt-blue-soft: #eff6ff;
  --drt-accent: currentColor;
  --drt-on-blue: #fff;
  --drt-ink: #0f172a;
  --drt-muted: #475569;
  --drt-subtle: #64748b;
  --drt-faint: #94a3b8;
  --drt-surface: #fff;
  --drt-sunken: #f8fafc;
  --drt-line: #e2e8f0;
  --drt-line-strong: #cbd5e1;
  --drt-grid: #eef2f6;
  --drt-shadow: #0f172a;
  --drt-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --drt-mono: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  --drt-ease: ease;
  --drt-chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6l4 4 4-4'/></svg>");
  --drt-series0: #2563eb;
  --drt-series1: #0d9488;
  --drt-series2: #d97706;
  --drt-series3: #db2777;
  --drt-series4: #65a30d;
  --drt-warn-ink: #7c2d12;
  --drt-warn-soft: #fff7ed;
  --drt-warn-line: #fed7aa;
  --drt-error-ink: #991b1b;
  --drt-error-soft: #fef2f2;
  --drt-error-line: #fecaca;
  --drt-status-ink: #334155;
  --drt-status-soft: #f1f5f9;
  --drt-status-line: #cbd5e1;
  --drt-status-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

Classes

Every class the runtime's stylesheets style, and every class it puts on what it draws. Each is yours to target.

Every widget

ClassWhat it is
.drtOn every widget the runtime draws: sets its font to --drt-sans and its text to --drt-ink.
.drt-emptyThe sentence a widget shows when nothing matches the current filters.
.drt-empty-actionThe one button that can sit under that sentence.
.drt-refusalThe sentence a widget shows when it will not draw a number it cannot show exactly.
.drt-fadeThe short fade some widgets play as they redraw.
.drt-srText for screen readers only, such as the loading announcement.

Figures you mark up yourself

The runtime styles these and never adds them: put them on your own markup to get the runtime's figure look.

ClassWhat it is
.drt-kpiA figure card.
.drt-kpi-labelIts label.
.drt-kpi-valueIts figure.
.drt-numAny figure, in the mono face with tabular numerals.

Filters and viewer controls

ClassWhat it is
.drt-filterA filter widget.
.drt-filter-labelIts label.
.drt-selectThe filter, date-range, sort and top-N dropdowns, with --drt-chevron as their arrow. The View detail's sort is .drt-drill-sort and keeps the browser's own arrow.
.drt-mc-wrapA filter that takes several values.
.drt-mc-triggerIts button.
.drt-mc-summaryThe button's text.
.drt-mc-chevThe button's arrow, in --drt-subtle.
.drt-mc-panelThe open list.
.drt-mc-headThe list's top row, which holds Clear.
.drt-mc-listThe options.
.drt-mc-optOne option.
.drt-mc-boxIts checkbox.
.drt-mc-checkThe check mark in a selected box.
.drt-mc-txtThe option's text.
.drt-rgA date-range filter.
.drt-rg-fieldOne end of the range.
.drt-rg-capIts From or To caption.
.drt-rg-selIts dropdown.
.drt-rg-sepThe separator between the two ends.
.drt-fx-clearThe Clear action on a filter.
.drt-fx-noteThe sentence a filter shows when it has no values or too many.
.drt-ctlThe sort and top-N bar above a table or chart.
.drt-ctl-groupOne control in it.
.drt-ctl-labIts label.
.drt-ctl-selIts dropdown.
.drt-resetThe floating Reset button, shown once a viewer has changed a control.
.drt-reset-icoIts icon.
.drt-reset-txtIts label.

Tables

ClassWhat it is
.drt-table-wrapA table's scrolling frame.
.drt-tableThe table.
.drt-col-numA numeric column's header and cells.
.drt-tbl-noteThe note under a table whose rows were cut.

Charts

ClassWhat it is
.drt-chartA chart widget.
.drt-axisAn axis's numbers.
.drt-catA category label.
.drt-barA bar.
.drt-lineA line.
.drt-areaThe fill under an area chart, --drt-blue at 10%.
.drt-dotA point on a line.
.drt-gridlineA gridline.
.drt-baselineThe zero line.
.drt-xfA mark that filters the page when clicked.
.drt-xf-selThe selected mark.
.drt-xf-dimThe other marks while one is selected.
.drt-legendA legend.
.drt-legend-itemOne entry.
.drt-legend-swIts swatch.
.drt-legend-labIts label.
.drt-ms-lineA series line on a multi-series chart.
.drt-ms-barA series bar.
.drt-ms-dotA series point.
.drt-ms-endlabThe label at the end of a series line.

Stacked and combo charts

ClassWhat it is
.drt-sc-segA stacked segment.
.drt-sc-totalThe total above a stacked column.
.drt-sc-axis2A combo chart's second axis.
.drt-sc-noteThe note under the chart.

Matrix and heatmap

ClassWhat it is
.drt-mxThe matrix.
.drt-mx-cornerIts corner cell.
.drt-mx-totalA total.
.drt-mx-blankAn intersection with no data.
.drt-mx-noteThe note under the matrix.
.drt-hm-cellA heatmap cell.
.drt-hm-voidA cell with no value.
.drt-hm-legendThe heatmap's legend.
.drt-hm-rampThe legend's colour ramp.
.drt-hm-swOne step of the ramp.
.drt-hm-endA value at either end of the ramp.

Pie, donut and gauge

ClassWhat it is
.drt-radThe chart.
.drt-rad-wrapThe chart and its key.
.drt-rad-figThe chart's half.
.drt-rad-keyThe key's half.
.drt-rad-itemA row of the key.
.drt-rad-valThat row's value.
.drt-rad-centerThe figure at the centre of a donut or gauge.
.drt-rad-captionThe caption under it.
.drt-rad-scaleA gauge's scale ends.
.drt-rad-trackA gauge's track.
.drt-rad-fillA gauge's filled arc.
.drt-rad-targetA gauge's target mark.
.drt-rad-noteThe note under the chart.

Scatter, treemap, waterfall and funnel

ClassWhat it is
.drt-sc-ptA scatter point.
.drt-sc-labA scatter point's label.
.drt-tm-rectA treemap rectangle.
.drt-tm-keyIts label.
.drt-tm-valIts value.
.drt-wf-barA waterfall step that rises.
.drt-wf-downA step that falls.
.drt-wf-totalThe total.
.drt-wf-linkThe dashed line between steps.
.drt-fn-barA funnel stage.
.drt-fn-emptyA stage with no value.
.drt-an-noteThe note under any of these.

Drill down

ClassWhat it is
.drt-dqThe drill-down table.
.drt-dq-crumbsThe breadcrumb row.
.drt-dq-crumbA breadcrumb link, in --drt-accent.
.drt-dq-curThe current level.
.drt-dq-sepA separator.
.drt-dq-intoA row's descend control, in --drt-accent on hover.
.drt-dq-labA row label that does not descend.
.drt-dq-otherThe Other row.
.drt-dq-noteThe note under the table.

View detail

ClassWhat it is
.drt-drill-btnThe View detail button.
.drt-drill-overlayThe dialog's backdrop, --drt-shadow at 44%.
.drt-drill-panelThe dialog.
.drt-drill-headIts header.
.drt-drill-titleIts title.
.drt-drill-sortIts sort dropdown.
.drt-drill-closeIts close button.
.drt-drill-noteIts note line.
.drt-drill-bodyIts scrolling body.
.drt-drill-emptyWhat it shows when there are no records.

Lines under a widget

ClassWhat it is
.drt-asof"as of" and a time, on a widget whose data is not the latest.
.drt-scopeThe line naming a filter that does not apply to the widget.
.drt-tiThe line that says what a period change compares.
.drt-retryThe retry button on a refusal a viewer can act on.

Loading

ClassWhat it is
.drt-skelA placeholder block.
.drt-skel-animA placeholder that pulses.
.drt-skel-valueA figure's placeholder.
.drt-skel-labelA label's placeholder.
.drt-skel-controlA control's placeholder.
.drt-skel-blockA chart's placeholder.
.drt-skel-tableA table's placeholder.
.drt-skel-rowOne row of it.

Page notices and bars

ClassWhat it is
.drt-author-barThe thin bar across the top while a page with page code is waiting for data.
.drt-author-truncatedThe notice that a result is partial.
.drt-author-thrownThe notice that one of the page's own callbacks threw.
.drt-capacity-barThe bar that gives the date a dashboard's data is from.
.drt-archived-version-barThe bar on an archived version's preview.
.dsh-custom-mountA custom mount in a body published before pages; it dims while its data loads.

States

The attributes the runtime's stylesheets key on. Each can be part of your selectors too.

AttributeWhereWhat it means
aria-busya widgettrue while its data is on the way.
data-drt-serveda widgetIts numbers come from Dashies when the page is opened, so a change of filter waits on the network.
data-dasha widgetIts role.
aria-expanded.drt-mc-triggertrue while its list is open.
aria-selected.drt-mc-opttrue on a selected option.
disabled.drt-retry, .drt-fx-clearThe control cannot be used right now.
hidden.drt-resetNo control has been changed, so there is nothing to reset.
data-dashies-pending<html>A dataset the page's code asked for is on the way.
data-dashies-truncated<html>A result the page's code was handed is partial.
data-dashies-indicators<html>Set it to none to hide the pending bar and the partial-result notice.

What no token or class reaches

  • Inline colours. A multi-series chart's marks and a pie or donut's slices take their colour inline from --drt-seriesN, so set the series tokens: a class rule without !important loses to an inline style. Set inline by the runtime's script, with no token reaching them yet: a heatmap's colour ramps, its legend swatches and the text colour it picks for contrast, all of which a matrix with data-color draws too, and the grey hatching on a cell whose value cannot be shown exactly.
  • Chart padding. It is a fixed number of pixels, so larger axis labels can run outside the chart.
  • --drt-bottom-bars. The runtime sets it on <html> while the archived-version bar is up, to lift the Reset button above both bars. It is layout state, not a token to set.

Check it worked

  1. Set the whole token block to your brand and open the page. Nothing the runtime draws should keep a default colour except the inline colours listed above.
  2. Tab through the controls. Each focus ring should be your accent.
  3. Write one class rule without !important, such as a new padding on .drt-table td, and confirm it applies.