Style variables
A widget’s style reads the theme through these variables, so it looks right in every theme and on e-ink without a line of its own for each.
Surfaces and text
--hd-canvas | The page behind the tiles: a colour or a gradient. |
--hd-surface | A tile’s colour. |
--hd-surface-fill | What a tile is painted with: the surface, or the theme’s gradient for it. |
--hd-surface-raised | Something on a tile that stands out from it, like a button. |
--hd-overlay | Menus, dialogs and popups over the page. |
--hd-border | Lines round tiles and between parts. |
--hd-text | Text and big numbers. |
--hd-text-muted | Labels and secondary text. |
--hd-text-faint | The quietest text: hints, units, times. |
--hd-track | The empty part of a slider, bar or ring. |
--hd-focus | The outline round what has keyboard focus. |
Accent and light
--hd-accent | The theme’s accent: active controls, links, highlights. |
--hd-accent-fill | What accented parts are painted with: the accent, or a gradient. |
--hd-on-accent | Text and icons on the accent. |
--hd-lit | The warm colour of a device that is on. |
--hd-lit-soft | A soft version of the lit colour, for washes and glows. |
--hd-lit-wash | The glow that fills a tile whose device is on (a flat tint on e-ink). |
--hd-cool | The cool counterpart: cooling, cold water, low prices on some themes. |
States and charts
--hd-good | All is well: locked, closed, cheap. |
--hd-warn | Worth a look: a low battery, a door open for a while. |
--hd-danger | Act now: smoke, a leak, an alarm. |
--hd-chart-1 | The first chart colour; charts and series use 1 to 6 in order. |
--hd-chart-2 | The second chart colour. |
--hd-chart-3 | The third chart colour. |
--hd-chart-4 | The fourth chart colour. |
--hd-chart-5 | The fifth chart colour. |
--hd-chart-6 | The sixth chart colour. |
--hd-chart-fill | How strongly an area under a chart line is filled, 0 to 1 (0 on e-ink). |
--hd-price-cheap | A cheap hour on price bars and in the energy widgets. |
--hd-price-normal | An ordinary hour. |
--hd-price-high | An expensive hour. |
--hd-price-negative | An hour you get paid to use energy. |
Numbers and type
--hd-font-display | The font of big numbers and headings. |
--hd-font-ui | The font of labels and running text. |
--hd-font-mono | The monospaced font of small labels. |
--hd-number-weight | How bold big numbers are. |
--hd-number-stretch | How wide big numbers are, as a font stretch. |
--hd-number-fill | What big numbers are painted with: the text colour, or a gradient. |
--hd-number-clip | 1 when big numbers are a gradient: paint them with background-clip: text. |
--hd-label-transform | How labels are cased: uppercase, or as written. |
--hd-label-tracking | The letter spacing of labels. |
Shape and depth
--hd-radius-sm | Small corners: chips, small buttons. |
--hd-radius-md | Medium corners: buttons, fields. |
--hd-radius-lg | Large corners: tiles. |
--hd-border-width | How thick borders are. |
--hd-pad | The room inside a tile. |
--hd-gap | The room between tiles. |
--hd-collapse | 1 when tiles share their borders, as on e-ink. |
--hd-shadow | A tile’s shadow. |
--hd-shadow-lit | The shadow and glow of a tile whose device is on. |
--hd-blur | The frosted-glass filter behind tiles, or none. |
--hd-texture | A grain over tiles, or none. |
Motion and e-ink
--hd-motion-level | full, reduced or none: how much is allowed to move. |
--hd-motion-fast | A quick change, like a press. 0ms when nothing may move. |
--hd-motion-base | An ordinary change, like a value sliding. |
--hd-motion-slow | A slow change, like a theme switching. |
--hd-ease-out | The easing of most movement. |
--hd-ease-spring | A springy easing, for things that bounce into place. |
--hd-flat | 1 on e-ink: no colours, glows or gradients, only black and white. |
--hd-appearance | light, dark or paper, for what colours alone can’t decide. |
The tile’s layout
Set by the tile’s alignment in the Style panel; read them to place your content.
--hd-item-align | Where the content sits up and down (manifest align.y), e.g. justify-content: var(--hd-item-align, flex-end) in a column. |
--hd-item-justify | Where the content sits sideways (manifest align.x), e.g. justify-content: var(--hd-item-justify, flex-start) in a row. stretch when the items share the width: then read the two below too. |
--hd-item-repeat | Set when the items move sideways or share the width: grid columns that aren’t used go, e.g. repeat(var(--hd-item-repeat, auto-fill), minmax(120px, var(--hd-item-track, 1fr))). |
--hd-item-track | Set with --hd-item-repeat: the columns fold to their content to move (max-content), or split the width when the items share it (1fr). |
--hd-item-grow | Set while the items share the width: items in a row grow, e.g. flex-grow: var(--hd-item-grow, 0). |
Settings
Every simple setting of the widget reaches its style too, as --setting- and its name in kebab case: a colour setting accentColor isvar(--setting-accent-color). A size setting adds -scale (0.85, 1 or 1.25).