Draw each dashboard on a round panel's track in its own look

The canvas states the look of the dashboard shown, so a neighbour beside it
and the one a turn leaves wore that look too. Each page now restates its own
look, theme and palette. The ring's paint moves from rules under
[data-look] to variables each look sets on its root, which stop at the
nearer root where a descendant rule reached into both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
2026-10-15 16:00:10 +02:00
co-authored by Claude Opus 5.5
parent c2adc2c526
commit 4ae8535cbb
6 changed files with 107 additions and 86 deletions
@@ -425,7 +425,7 @@
);
--dui-reading: var(--foreground);
--dui-reading-reached: var(--primary-foreground);
--dui-reading-on-handle: var(--foreground);
--dui-reading-on-handle: var(--dui-on-handle, var(--foreground));
}
/*
@@ -785,6 +785,47 @@
outline: none;
}
/*
* The ring's paint. Each look states it on its root as these variables rather
* than in rules under `[data-look]`: a round panel draws a dashboard beside
* one in another look, and a descendant rule would reach into both, where an
* inherited value stops at the nearer root. Reset on every root, so a look
* that leaves one out takes the fallback rather than the outer root's.
*/
:where([data-look]) {
--dui-ring-track: initial;
--dui-ring-glow: initial;
--dui-ring-handle: initial;
--dui-ring-handle-edge: initial;
--dui-ring-handle-edge-width: initial;
--dui-ring-handle-shadow: initial;
--dui-ring-swatch: initial;
--dui-ring-swatch-width: initial;
--dui-on-handle: initial;
}
.dui-ring-track {
stroke: var(--dui-ring-track, var(--muted));
}
.dui-ring-fill {
stroke: var(--primary);
filter: var(--dui-ring-glow, none);
}
.dui-ring-handle {
fill: var(--dui-ring-handle, var(--primary));
stroke: var(--dui-ring-handle-edge, none);
stroke-width: var(--dui-ring-handle-edge-width, 0);
filter: var(--dui-ring-handle-shadow, none);
}
/* A colour's handle is filled with the colour, so only its edge is the look's. */
.dui-ring-swatch {
stroke: var(--dui-ring-swatch, var(--card));
stroke-width: var(--dui-ring-swatch-width, 3px);
}
.dui-ring-hit {
pointer-events: stroke;
cursor: pointer;
@@ -21,6 +21,12 @@
[data-look="fluksio"] {
--fx-radius: var(--radius-lg);
--fx-field: var(--radius-md);
/* A round face's ring (`core.css`): the slider's handle, a ring of primary
around the page colour. */
--dui-ring-handle: var(--background);
--dui-ring-handle-edge: var(--primary);
--dui-ring-handle-edge-width: 2px;
--dui-ring-handle-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / 0.2));
}
/* --- surfaces ------------------------------------------------------------ */
@@ -315,26 +321,3 @@
outline: none;
box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent);
}
/* --- a round dashboard's ring -------------------------------------------- */
[data-look="fluksio"] .dui-ring-track {
stroke: var(--muted);
}
[data-look="fluksio"] .dui-ring-fill {
stroke: var(--primary);
}
/* The slider's handle: a ring of primary around the page colour. */
[data-look="fluksio"] .dui-ring-handle {
fill: var(--background);
stroke: var(--primary);
stroke-width: 2px;
filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.2));
}
[data-look="fluksio"] .dui-ring-swatch {
stroke: var(--card);
stroke-width: 3px;
}
@@ -29,6 +29,17 @@
/* A round face's press, which has no card behind it. See below. */
--gl-press: var(--gl-bg);
--gl-press-shadow: var(--gl-inset);
/* A round face's ring (`core.css`): lit, as the gauge's arc is, under a
white handle, which a reading's dot on it shows dark against. */
--dui-ring-track: var(--gl-track);
--dui-ring-glow: drop-shadow(0 0 4px var(--primary));
--dui-ring-handle: #fff;
--dui-ring-handle-edge: var(--gl-border);
--dui-ring-handle-edge-width: 1px;
--dui-ring-handle-shadow: drop-shadow(0 2px 8px rgb(0 0 0 / 0.35));
--dui-ring-swatch: rgb(255 255 255 / 0.85);
--dui-ring-swatch-width: 2px;
--dui-on-handle: rgb(0 0 0 / 0.75);
}
[data-look="glass"].light {
@@ -433,32 +444,3 @@
outline: 2px solid var(--ring);
outline-offset: 2px;
}
/* --- a round dashboard's ring -------------------------------------------- */
[data-look="glass"] .dui-ring-track {
stroke: var(--gl-track);
}
/* Lit, as the gauge's arc is. */
[data-look="glass"] .dui-ring-fill {
stroke: var(--primary);
filter: drop-shadow(0 0 4px var(--primary));
}
[data-look="glass"] .dui-ring-handle {
fill: #fff;
stroke: var(--gl-border);
stroke-width: 1px;
filter: drop-shadow(0 2px 8px rgb(0 0 0 / 0.35));
}
/* A reading's dot on the handle, which is white here in either theme. */
[data-look="glass"] :is(.dui-ring, .dui-slider) {
--dui-reading-on-handle: rgb(0 0 0 / 0.75);
}
[data-look="glass"] .dui-ring-swatch {
stroke: rgb(255 255 255 / 0.85);
stroke-width: 2px;
}
@@ -19,6 +19,10 @@
--m3-sc: color-mix(in oklab, var(--primary) 22%, var(--card));
--m3-outline: var(--border);
--m3-radius: 1rem;
/* A round face's ring (`core.css`): a tonal track under a primary handle,
which a reading's dot on it shows light against. */
--dui-ring-track: var(--m3-sc);
--dui-on-handle: var(--primary-foreground);
}
/* --- surfaces ----------------------------------------------------------- */
@@ -319,27 +323,3 @@
outline: 2px solid var(--primary);
outline-offset: 2px;
}
/* --- a round dashboard's ring -------------------------------------------- */
[data-look="material"] .dui-ring-track {
stroke: var(--m3-sc);
}
[data-look="material"] .dui-ring-fill {
stroke: var(--primary);
}
[data-look="material"] .dui-ring-handle {
fill: var(--primary);
}
/* A reading's dot on the handle, which is primary here. */
[data-look="material"] :is(.dui-ring, .dui-slider) {
--dui-reading-on-handle: var(--primary-foreground);
}
[data-look="material"] .dui-ring-swatch {
stroke: var(--card);
stroke-width: 3px;
}