Salud: one colour per family of metric, so the grid reads at a glance
Tests / test (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s

Every card carried the same white number, which meant reading fourteen labels to find
the one you came for. Each family now has a colour — activity green, heart pink, body
blue, sleep indigo, vitals teal, everything unrecognised grey — and the card's number,
its icon, its sparkline and a low wash behind it all read from a single `--tint` property
set by lib/vitals-view.js. The detail sheet follows the same tint, so opening a card keeps
its colour.

The tints are the app's own palette variables, not hex values: the light theme redefines
every one of them, so a card stays legible in both. They are deliberately not `var(--acc)`
— the accent is whatever the person chose in Settings, and a dashboard whose "steps" colour
changes with the theme accent is one nobody can learn. Grey for the unknown group is the
honest choice: an unrecognised metric has no family to colour.

The wash is 8% on purpose. The colour is there to sort the grid, not to shout, and a
saturated tile behind a 26px number fights the number it is meant to highlight; the value
itself carries the colour at full strength.

Guarded twice: vitals-view.test.js checks every group resolves to a tint and that no two
groups share one (sharing would defeat the point), and the render test checks the cards
actually carry `--tint` — the wiring, not the shades, which is the part that can silently
break.
This commit is contained in:
dsantillan committed 2026-09-23 11:19:15 -04:00
1 parent 4222e8d86b
commit 3b7c9011c4
5 files changed
+66 -8

No files matched your search

+11 -2
View File
@@ -1271,9 +1271,18 @@ body.chips-dragging *{cursor:inherit}
A health card is a tile with three more things in it: a unit, a trend arrow and a four-point
sparkline. The sparkline is what makes the grid readable at a glance — a bare "12,481" says
nothing about whether that is a good week — so it gets its own fixed-height box rather than
being allowed to stretch the card when a metric has only one day of data. */
.vh-card{width:100%;text-align:left;display:block;font:inherit;color:inherit;padding-bottom:10px}
being allowed to stretch the card when a metric has only one day of data.
Each card carries a `--tint` from lib/vitals-view.js (one colour per family of metric), and
everything coloured on the card reads from it: the number, the icon, the sparkline and a wash
behind the card. The wash is kept low (8%) on purpose — the colour is there to sort the grid at
a glance, not to shout, and a saturated tile behind a 26px number would fight the number. */
.vh-card{--tint:var(--grey);width:100%;text-align:left;display:block;font:inherit;color:inherit;padding-bottom:10px;
background:color-mix(in srgb,var(--tint) 8%,var(--surface))}
.vh-card .l .icn{color:var(--tint)}
.vh-card .v{color:var(--tint)}
.vh-unit{margin-left:4px;font-size:14px;font-weight:500;color:var(--label-2);letter-spacing:0}
.vh-big{font-size:34px;color:var(--tint)}
.vh-trend{
float:right;display:inline-flex;align-items:center;gap:1px;
font-size:13px;font-weight:500;letter-spacing:0;