A dashboard could only ever receive as a set of tiles. This adds the dashboard itself as a receiver: `settings` maps a name to a value plus an optional binding. Unbound, the setting is simply its value — a wall panel that is always dark costs no flow. Bound, a flow drives it live and the value is the fallback. Two settings are wired: `theme` (system/light/dark) and `locked` (read-only). There is no schedule field on purpose — a node publishing to the bound message on a cron is what a schedule is here, which is the point of a channel. - `messages_for()` now walks a dashboard's bound settings as well as its widgets' bindings. Without this a paired screen is refused its own theme message, on the one surface the setting exists for; it bounds the socket too. - `locked` is gated in `usePublish`, so every control inherits it, and each control also draws itself disabled — a dead button reads as broken otherwise. The panel surface says Read-only in the corner. - The theme is a class on the dashboard's own surface, never the root: inside the app shell it must not flip the chrome. `.light` gains the tokens `.dark` already had (mirrored in the index repo) so both directions work on a subtree. - Settings bindings are type-checked from the document alone, the rule widget bindings follow, and mirrored on the server. - A bound setting is drawn on the flow canvas as a dashboard-level endpoint. - The demo's house flow now publishes `home.panel_theme`, which the demo dashboard's theme binds to: the panel goes dark after sunset, at no tile cost. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018tULRZJUkZsw7rMJ3h4xvu
214 lines
7.5 KiB
CSS
214 lines
7.5 KiB
CSS
@import "tailwindcss";
|
|
@import "tw-animate-css";
|
|
|
|
@custom-variant dark (&:is(.dark *));
|
|
|
|
/*
|
|
* Self-hosted font, duplicated verbatim across the fluksio and website repos (a
|
|
* sync point like `lib/motion.ts`; see the root DESIGN-GUIDELINES.md,
|
|
* Typography). Kept OUT of the byte-identical `@theme inline` / `:root` /
|
|
* `.dark` blocks. Inter is used for both body (set on `body` in `@layer base`)
|
|
* and the display face applied via the `.font-display` class below.
|
|
*/
|
|
@font-face {
|
|
font-family: "Inter";
|
|
font-style: normal;
|
|
font-weight: 100 900;
|
|
font-display: swap;
|
|
src: url("/fonts/inter-latin-variable.woff2") format("woff2");
|
|
}
|
|
|
|
@theme inline {
|
|
--radius: 1rem; /* base: surface radius (16px) */
|
|
--radius-sm: 0.5rem; /* 8px: checkbox, small chips, nested items */
|
|
--radius-md: 0.75rem; /* 12px: menus, popovers, dropdowns, tooltips, textarea */
|
|
--radius-lg: 1rem; /* 16px: cards, panels, dialogs, alerts, sidebar */
|
|
--radius-xl: 1.75rem; /* 28px: large / hero containers */
|
|
/* Controls (button/input/toggle/chip) use the `rounded-full` utility (pill). */
|
|
|
|
/* Two-layer elevation: cards rest low (e1); floating surfaces e2; modals e3. */
|
|
--shadow-e1: 0 1px 2px rgb(0 0 0 / 0.06), 0 1px 3px rgb(0 0 0 / 0.1);
|
|
--shadow-e2: 0 2px 6px rgb(0 0 0 / 0.08), 0 4px 12px rgb(0 0 0 / 0.12);
|
|
--shadow-e3: 0 8px 24px rgb(0 0 0 / 0.18), 0 2px 8px rgb(0 0 0 / 0.12);
|
|
|
|
/* Shared motion timing, consumed by CSS transitions and the lib/motion.ts presets. */
|
|
--ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
|
|
--ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
|
|
--duration-fast: 150ms;
|
|
--duration-base: 200ms;
|
|
--duration-slow: 300ms;
|
|
/* One-shot feedback (a message arriving, a node emitting) rather than a UI
|
|
state change, so it lingers long enough to be noticed. */
|
|
--duration-pulse: 500ms;
|
|
--color-background: var(--background);
|
|
--color-foreground: var(--foreground);
|
|
--color-card: var(--card);
|
|
--color-card-foreground: var(--card-foreground);
|
|
--color-popover: var(--popover);
|
|
--color-popover-foreground: var(--popover-foreground);
|
|
--color-primary: var(--primary);
|
|
--color-primary-foreground: var(--primary-foreground);
|
|
--color-primary-nested: var(--primary-nested);
|
|
--color-brand-secondary: var(--brand-secondary);
|
|
--color-brand-secondary-foreground: var(--brand-secondary-foreground);
|
|
--color-secondary: var(--secondary);
|
|
--color-secondary-foreground: var(--secondary-foreground);
|
|
--color-muted: var(--muted);
|
|
--color-muted-foreground: var(--muted-foreground);
|
|
--color-accent: var(--accent);
|
|
--color-accent-foreground: var(--accent-foreground);
|
|
--color-destructive: var(--destructive);
|
|
--color-border: var(--border);
|
|
--color-input: var(--input);
|
|
--color-ring: var(--ring);
|
|
--color-sidebar: var(--sidebar);
|
|
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
--color-sidebar-primary: var(--sidebar-primary);
|
|
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
--color-sidebar-accent: var(--sidebar-accent);
|
|
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
--color-sidebar-border: var(--sidebar-border);
|
|
--color-sidebar-ring: var(--sidebar-ring);
|
|
--color-status-success: var(--status-success);
|
|
--color-chart-1: var(--chart-1);
|
|
--color-chart-2: var(--chart-2);
|
|
--color-chart-3: var(--chart-3);
|
|
--color-chart-4: var(--chart-4);
|
|
--color-chart-5: var(--chart-5);
|
|
--font-mono:
|
|
ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas,
|
|
monospace;
|
|
}
|
|
|
|
/*
|
|
* Fluksio palette. Neutral surfaces, brand on controls only.
|
|
*
|
|
* `--primary` is #4a7189, not the identity blue #59849b: the latter measures
|
|
* 4.04:1 against white, below AA for the label sitting on a bg-primary fill.
|
|
* #59849b remains the wordmark colour (index/src/assets/fluksio-*.svg). See the root
|
|
* DESIGN-GUIDELINES.md → Colour tokens.
|
|
*
|
|
* `--primary-nested` is that same hue and saturation a few steps deeper, for
|
|
* a reading drawn inside a `--primary` fill — the bar widget's stacked
|
|
* segments. No slot of the chart ramp clears the 3:1 non-text guideline
|
|
* against `--primary` (`--chart-5`, which the bar used, measures 2.53:1), so
|
|
* the nested fill needs a token of its own. It cannot clear 3:1 against
|
|
* `--muted` as well in dark: `--primary` and `--muted` are only 5.82:1 apart
|
|
* there, and a colour 3:1 from both would have to sit in a 9:1 gap. The
|
|
* segment is therefore drawn inside a gutter of the fill rather than ever
|
|
* bordering the track.
|
|
*/
|
|
/* `.light` is the symmetric half of `.dark` below: both are plain classes, so
|
|
either themes a subtree as well as the whole document — which is what lets a
|
|
dashboard forced to one theme sit inside a shell on the other. `:root` is
|
|
listed second so the parity grep keeps its anchor line. */
|
|
.light,
|
|
:root {
|
|
--background: #ffffff;
|
|
--foreground: #333232;
|
|
--card: #ffffff;
|
|
--card-foreground: #333232;
|
|
--popover: #ffffff;
|
|
--popover-foreground: #333232;
|
|
--primary: #4a7189;
|
|
--primary-foreground: #ffffff;
|
|
--primary-nested: #152128; /* on --primary 3.14:1, on --muted 14.6:1 */
|
|
--brand-secondary: #de8f6e;
|
|
--brand-secondary-foreground: #333232;
|
|
--secondary: #f2f2f2;
|
|
--secondary-foreground: #333232;
|
|
--muted: #f2f2f2;
|
|
--muted-foreground: #6b6b6b;
|
|
--accent: #f5f5f5;
|
|
--accent-foreground: #333232;
|
|
--destructive: #b94d4d;
|
|
--border: #e4e4e4;
|
|
--input: #e4e4e4;
|
|
--ring: #4a7189;
|
|
--sidebar: #ffffff;
|
|
--sidebar-foreground: #333232;
|
|
--sidebar-primary: #4a7189;
|
|
--sidebar-primary-foreground: #ffffff;
|
|
--sidebar-accent: #f5f5f5;
|
|
--sidebar-accent-foreground: #333232;
|
|
--sidebar-border: #e4e4e4;
|
|
--sidebar-ring: #4a7189;
|
|
--status-success: #5e8b6d;
|
|
--chart-1: #3f5f74;
|
|
--chart-2: #4f768e;
|
|
--chart-3: #688ba1;
|
|
--chart-4: #83a2b5;
|
|
--chart-5: #9eb8c9;
|
|
}
|
|
|
|
.dark {
|
|
--background: #0a0a0a;
|
|
--foreground: #f5f5f5;
|
|
--card: #1a1a1a;
|
|
--card-foreground: #f5f5f5;
|
|
--popover: #1a1a1a;
|
|
--popover-foreground: #f5f5f5;
|
|
--primary: #7ba3b8;
|
|
--primary-foreground: #0a0a0a;
|
|
--primary-nested: #345160; /* on --primary 3.12:1, on --muted 1.86:1 */
|
|
--brand-secondary: #e5a184;
|
|
--brand-secondary-foreground: #0a0a0a;
|
|
--secondary: #232323;
|
|
--secondary-foreground: #f5f5f5;
|
|
--muted: #232323;
|
|
--muted-foreground: #a3a3a3;
|
|
--accent: #262626;
|
|
--accent-foreground: #f5f5f5;
|
|
--destructive: #cf6666;
|
|
--border: #2a2a2a;
|
|
--input: #2a2a2a;
|
|
--ring: #7ba3b8;
|
|
--sidebar: #1a1a1a;
|
|
--sidebar-foreground: #f5f5f5;
|
|
--sidebar-primary: #7ba3b8;
|
|
--sidebar-primary-foreground: #0a0a0a;
|
|
--sidebar-accent: #262626;
|
|
--sidebar-accent-foreground: #f5f5f5;
|
|
--sidebar-border: #2a2a2a;
|
|
--sidebar-ring: #7ba3b8;
|
|
--status-success: #87b596;
|
|
--chart-1: #94b0be;
|
|
--chart-2: #7999aa;
|
|
--chart-3: #5f8396;
|
|
--chart-4: #496d7f;
|
|
--chart-5: #395767;
|
|
}
|
|
|
|
@layer base {
|
|
* {
|
|
@apply border-border outline-ring/50;
|
|
}
|
|
body {
|
|
@apply bg-background text-foreground antialiased;
|
|
font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
|
|
}
|
|
button,
|
|
[role="button"] {
|
|
cursor: pointer;
|
|
}
|
|
/* Number fields are typed into, not clicked up and down one step at a time,
|
|
and the spinner crowds the pill. */
|
|
input[type="number"] {
|
|
-moz-appearance: textfield;
|
|
appearance: textfield;
|
|
}
|
|
input[type="number"]::-webkit-outer-spin-button,
|
|
input[type="number"]::-webkit-inner-spin-button {
|
|
-webkit-appearance: none;
|
|
appearance: none;
|
|
margin: 0;
|
|
}
|
|
}
|
|
|
|
/* Display face for headings / wordmarks. Plain class so it stays outside the
|
|
byte-identical token blocks; falls back to the body stack. */
|
|
.font-display {
|
|
font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
|
|
letter-spacing: -0.01em;
|
|
}
|