feat(webui): adopt the violet palette, and give the outlet the viewport
Takes style.css, lib/theme.ts and index.html's pre-paint script from the palette work on worktree-groovy-imagining-widget (73e602a7..72034249), leaving its flat topbar and route table behind. The theme is a data-theme attribute set before the first paint, so a reload does not flash the wrong palette, and color-scheme moves with it. The outlet takes the viewport height below the topbar so an empty state has somewhere to sit.
This commit is contained in:
7 files changed
+272
-131
No files matched your search
+1
-1
@@ -13,7 +13,7 @@ onMounted(() => {
|
||||
<template>
|
||||
<TooltipProvider :delay-duration="350">
|
||||
<Topbar :hidden="hidden" />
|
||||
<main>
|
||||
<main class="min-h-[calc(100svh-3.5rem)]">
|
||||
<!--
|
||||
Keyed on the path and its parameters but not the query: a query-only
|
||||
change is an entry state, so the page keeps the operator's filters,
|
||||
|
||||
+36
-19
@@ -1,33 +1,50 @@
|
||||
import { ref, watchEffect } from "vue";
|
||||
import { ref, type Ref } from "vue";
|
||||
|
||||
/**
|
||||
* The theme is an attribute on <html>, not a class, because index.html sets it
|
||||
* from localStorage before the first paint. Everything downstream reads the CSS
|
||||
* variables once that attribute is present, so nothing in the app branches on
|
||||
* the theme itself.
|
||||
*/
|
||||
export const THEME_KEY = "archie.theme";
|
||||
|
||||
export type Theme = "dark" | "light";
|
||||
|
||||
const STORAGE_KEY = "archie.theme";
|
||||
export function isTheme(value: unknown): value is Theme {
|
||||
return value === "dark" || value === "light";
|
||||
}
|
||||
|
||||
function stored(): Theme | null {
|
||||
/** Dark is the default: archied is a daemon you check at odd hours. */
|
||||
export function storedTheme(): Theme {
|
||||
try {
|
||||
const value = localStorage.getItem(STORAGE_KEY);
|
||||
return value === "dark" || value === "light" ? value : null;
|
||||
const stored = localStorage.getItem(THEME_KEY);
|
||||
return isTheme(stored) ? stored : "dark";
|
||||
} catch {
|
||||
return null;
|
||||
// Private windows and blocked site data throw on access. The default is
|
||||
// correct there, so this is not worth surfacing.
|
||||
return "dark";
|
||||
}
|
||||
}
|
||||
|
||||
export const theme = ref<Theme>(stored() ?? "dark");
|
||||
|
||||
watchEffect(() => {
|
||||
const root = document.documentElement;
|
||||
root.classList.toggle("dark", theme.value === "dark");
|
||||
// Binds the UA's own painting (form controls, scrollbars, the canvas behind
|
||||
// an overscroll) to the theme.
|
||||
root.style.colorScheme = theme.value;
|
||||
export function applyTheme(theme: Theme): void {
|
||||
document.documentElement.dataset.theme = theme;
|
||||
try {
|
||||
localStorage.setItem(STORAGE_KEY, theme.value);
|
||||
localStorage.setItem(THEME_KEY, theme);
|
||||
} catch {
|
||||
// A blocked store costs persistence, not the toggle.
|
||||
// The theme still applies for this page view; only persistence is lost.
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function toggleTheme() {
|
||||
theme.value = theme.value === "dark" ? "light" : "dark";
|
||||
const current = ref<Theme>(storedTheme());
|
||||
|
||||
/** The live theme, shared app-wide. Apply it through `setTheme` or `toggleTheme`. */
|
||||
export const theme: Ref<Theme> = current;
|
||||
|
||||
export function setTheme(next: Theme): void {
|
||||
current.value = next;
|
||||
applyTheme(next);
|
||||
}
|
||||
|
||||
export function toggleTheme(): void {
|
||||
setTheme(current.value === "dark" ? "light" : "dark");
|
||||
}
|
||||
+204
-109
@@ -1,129 +1,224 @@
|
||||
|
||||
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&display=swap');
|
||||
|
||||
@import "@fontsource-variable/geist";
|
||||
|
||||
@import "tailwindcss";
|
||||
@import "tw-animate-css";
|
||||
@import "shadcn-vue/tailwind.css";
|
||||
|
||||
@custom-variant dark (&:is(.dark *));
|
||||
/* The theme is an attribute on <html>, not a class, so the inline script in
|
||||
index.html can set it before the first paint and a reload does not flash the
|
||||
wrong palette. */
|
||||
@custom-variant dark (&:is([data-theme="dark"] *));
|
||||
|
||||
/*
|
||||
* Design tokens. Dark is the default because archied is a daemon you check at
|
||||
* odd hours; light is a toggle, not an afterthought, so both themes define the
|
||||
* same variable set and nothing else in the app references a raw colour.
|
||||
*
|
||||
* Semantic names only. Never `--violet`; always `--primary` or `--ok`, so a
|
||||
* palette change is one file rather than a grep.
|
||||
*
|
||||
* Names on the left are shadcn-vue's contract, so its components pick the
|
||||
* palette up with no per-component overrides. Names on the right that shadcn
|
||||
* does not define (status colours, the subtle foreground, the glass surfaces)
|
||||
* are ours.
|
||||
*
|
||||
* The dark theme is a saturated violet on a near-black canvas with a violet
|
||||
* cast; the light theme is the ink and cream set inverted. Every foreground is
|
||||
* checked against every surface it lands on, hover states included, at AA
|
||||
* (4.5:1), and the ratios in the comments are the measured ones.
|
||||
*/
|
||||
@theme inline {
|
||||
--font-sans: 'Geist Variable', sans-serif;
|
||||
--font-heading: var(--font-sans);
|
||||
--color-sidebar-ring: var(--sidebar-ring);
|
||||
--color-sidebar-border: var(--sidebar-border);
|
||||
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
||||
--color-sidebar-accent: var(--sidebar-accent);
|
||||
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
||||
--color-sidebar-primary: var(--sidebar-primary);
|
||||
--color-sidebar-foreground: var(--sidebar-foreground);
|
||||
--color-sidebar: var(--sidebar);
|
||||
--color-chart-5: var(--chart-5);
|
||||
--color-chart-4: var(--chart-4);
|
||||
--color-chart-3: var(--chart-3);
|
||||
--color-chart-2: var(--chart-2);
|
||||
--color-chart-1: var(--chart-1);
|
||||
--color-ring: var(--ring);
|
||||
--color-input: var(--input);
|
||||
--color-border: var(--border);
|
||||
--color-destructive: var(--destructive);
|
||||
--color-accent-foreground: var(--accent-foreground);
|
||||
--color-accent: var(--accent);
|
||||
--color-muted-foreground: var(--muted-foreground);
|
||||
--color-muted: var(--muted);
|
||||
--color-secondary-foreground: var(--secondary-foreground);
|
||||
--color-secondary: var(--secondary);
|
||||
--color-primary-foreground: var(--primary-foreground);
|
||||
--color-primary: var(--primary);
|
||||
--color-popover-foreground: var(--popover-foreground);
|
||||
--color-popover: var(--popover);
|
||||
--color-card-foreground: var(--card-foreground);
|
||||
--color-card: var(--card);
|
||||
--color-foreground: var(--foreground);
|
||||
--font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
|
||||
|
||||
--color-background: var(--background);
|
||||
--radius-sm: calc(var(--radius) - 4px);
|
||||
--radius-md: calc(var(--radius) - 2px);
|
||||
--radius-lg: var(--radius);
|
||||
--radius-xl: calc(var(--radius) + 4px);
|
||||
--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-soft: var(--primary-soft);
|
||||
--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-destructive-foreground: var(--destructive-foreground);
|
||||
--color-destructive-soft: var(--destructive-soft);
|
||||
--color-border: var(--border);
|
||||
--color-border-strong: var(--border-strong);
|
||||
--color-input: var(--input);
|
||||
--color-ring: var(--ring);
|
||||
--color-hairline: var(--hairline);
|
||||
|
||||
/* Foreground ramp. --muted-foreground is shadcn's; --fg-subtle is the
|
||||
quieter third step the dashboard's secondary text uses. */
|
||||
--color-fg-muted: var(--fg-muted);
|
||||
--color-fg-subtle: var(--fg-subtle);
|
||||
|
||||
/* Status. Task state, gate results and trend direction all draw from here,
|
||||
so the same colour always means the same thing wherever it appears. */
|
||||
--color-ok: var(--ok);
|
||||
--color-ok-soft: var(--ok-soft);
|
||||
--color-warn: var(--warn);
|
||||
--color-warn-soft: var(--warn-soft);
|
||||
--color-danger: var(--danger);
|
||||
--color-danger-soft: var(--danger-soft);
|
||||
--color-info: var(--info);
|
||||
--color-info-soft: var(--info-soft);
|
||||
--color-idle: var(--idle);
|
||||
--color-idle-soft: var(--idle-soft);
|
||||
|
||||
--radius-sm: 6px;
|
||||
--radius-md: 10px;
|
||||
--radius-lg: 14px;
|
||||
--radius-xl: 20px;
|
||||
}
|
||||
|
||||
:root {
|
||||
--background: oklch(1 0 0);
|
||||
--foreground: oklch(0.145 0 0);
|
||||
--card: oklch(1 0 0);
|
||||
--card-foreground: oklch(0.145 0 0);
|
||||
--popover: oklch(1 0 0);
|
||||
--popover-foreground: oklch(0.145 0 0);
|
||||
--primary: oklch(0.205 0 0);
|
||||
--primary-foreground: oklch(0.985 0 0);
|
||||
--secondary: oklch(0.97 0 0);
|
||||
--secondary-foreground: oklch(0.205 0 0);
|
||||
--muted: oklch(0.97 0 0);
|
||||
--muted-foreground: oklch(0.556 0 0);
|
||||
--accent: oklch(0.97 0 0);
|
||||
--accent-foreground: oklch(0.205 0 0);
|
||||
--destructive: oklch(0.577 0.245 27.325);
|
||||
--border: oklch(0.922 0 0);
|
||||
--input: oklch(0.922 0 0);
|
||||
--ring: oklch(0.708 0 0);
|
||||
--chart-1: oklch(0.87 0 0);
|
||||
--chart-2: oklch(0.556 0 0);
|
||||
--chart-3: oklch(0.439 0 0);
|
||||
--chart-4: oklch(0.371 0 0);
|
||||
--chart-5: oklch(0.269 0 0);
|
||||
--radius: 0.625rem;
|
||||
--sidebar: oklch(0.985 0 0);
|
||||
--sidebar-foreground: oklch(0.145 0 0);
|
||||
--sidebar-primary: oklch(0.205 0 0);
|
||||
--sidebar-primary-foreground: oklch(0.985 0 0);
|
||||
--sidebar-accent: oklch(0.97 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.205 0 0);
|
||||
--sidebar-border: oklch(0.922 0 0);
|
||||
--sidebar-ring: oklch(0.708 0 0);
|
||||
/* ── Dark (default) ─────────────────────────────────────────────────────── */
|
||||
:root,
|
||||
[data-theme="dark"] {
|
||||
color-scheme: dark;
|
||||
|
||||
/* Near-black carrying a violet cast, so the accent reads as light coming
|
||||
out of the canvas rather than a swatch laid on top of grey. */
|
||||
--background: #0F0A16;
|
||||
--card: #191026;
|
||||
--card-foreground: #F0EAF7;
|
||||
--popover: #1F1430;
|
||||
--popover-foreground: #F0EAF7;
|
||||
--foreground: #F0EAF7;
|
||||
|
||||
/* Ink on the violet is 5.64:1; white on it is 4.02:1 and fails, so the
|
||||
button label is the canvas colour in both directions, never white. */
|
||||
--primary: #A76BF5;
|
||||
--primary-foreground: #0F0A16;
|
||||
--primary-soft: rgba(167, 107, 245, 0.16);
|
||||
|
||||
/* shadcn's `accent` is the hover surface, not the brand colour. */
|
||||
--secondary: #271838;
|
||||
--secondary-foreground: #F0EAF7;
|
||||
--muted: #271838;
|
||||
--muted-foreground: #B9AECB;
|
||||
--accent: #271838;
|
||||
--accent-foreground: #F0EAF7;
|
||||
|
||||
--destructive: #F87A88;
|
||||
--destructive-foreground: #0F0A16;
|
||||
--destructive-soft: rgba(248, 122, 136, 0.16);
|
||||
|
||||
--border: #3A2A52;
|
||||
--border-strong: #503A6B;
|
||||
--input: #3A2A52;
|
||||
--ring: #A76BF5;
|
||||
|
||||
--fg-muted: #B9AECB;
|
||||
--fg-subtle: #A99DBD;
|
||||
|
||||
--ok: #4FD08C;
|
||||
--ok-soft: rgba(79, 208, 140, 0.16);
|
||||
--warn: #F0B65C;
|
||||
--warn-soft: rgba(240, 182, 92, 0.16);
|
||||
--danger: #F87A88;
|
||||
--danger-soft: rgba(248, 122, 136, 0.16);
|
||||
--info: #A76BF5;
|
||||
--info-soft: rgba(167, 107, 245, 0.16);
|
||||
--idle: #A79BB8;
|
||||
--idle-soft: rgba(167, 155, 184, 0.16);
|
||||
|
||||
/* The brand's second hue: the magenta the petals turn at their tips, so the
|
||||
canvas wash runs violet into magenta instead of one flat colour. */
|
||||
--brand-alt: #C061E8;
|
||||
--bg-blur: rgba(15, 10, 22, 0.6);
|
||||
/* Panels are translucent so the canvas wash shows through and the whole
|
||||
workspace reads as one lit surface rather than opaque cards on a picture. */
|
||||
--surface-glass: rgba(25, 16, 38, 0.62);
|
||||
--surface-glass-strong: rgba(15, 10, 22, 0.8);
|
||||
--workspace: rgba(12, 8, 18, 0.55);
|
||||
--hairline: rgba(240, 234, 247, 0.07);
|
||||
--wash-a: rgba(167, 107, 245, 0.14);
|
||||
--wash-b: rgba(192, 97, 232, 0.12);
|
||||
--wash-c: rgba(246, 239, 234, 0.04);
|
||||
|
||||
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
|
||||
--shadow-md: 0 8px 28px rgba(0, 0, 0, 0.5);
|
||||
--shadow-workspace: 0 24px 70px rgba(0, 0, 0, 0.6);
|
||||
|
||||
--transition: 140ms cubic-bezier(0.4, 0, 0.2, 1);
|
||||
--radius-pill: 999px;
|
||||
}
|
||||
|
||||
.dark {
|
||||
--background: oklch(0.145 0 0);
|
||||
--foreground: oklch(0.985 0 0);
|
||||
--card: oklch(0.205 0 0);
|
||||
--card-foreground: oklch(0.985 0 0);
|
||||
--popover: oklch(0.205 0 0);
|
||||
--popover-foreground: oklch(0.985 0 0);
|
||||
--primary: oklch(0.922 0 0);
|
||||
--primary-foreground: oklch(0.205 0 0);
|
||||
--secondary: oklch(0.269 0 0);
|
||||
--secondary-foreground: oklch(0.985 0 0);
|
||||
--muted: oklch(0.269 0 0);
|
||||
--muted-foreground: oklch(0.708 0 0);
|
||||
--accent: oklch(0.269 0 0);
|
||||
--accent-foreground: oklch(0.985 0 0);
|
||||
--destructive: oklch(0.704 0.191 22.216);
|
||||
--border: oklch(1 0 0 / 10%);
|
||||
--input: oklch(1 0 0 / 15%);
|
||||
--ring: oklch(0.556 0 0);
|
||||
--chart-1: oklch(0.87 0 0);
|
||||
--chart-2: oklch(0.556 0 0);
|
||||
--chart-3: oklch(0.439 0 0);
|
||||
--chart-4: oklch(0.371 0 0);
|
||||
--chart-5: oklch(0.269 0 0);
|
||||
--sidebar: oklch(0.205 0 0);
|
||||
--sidebar-foreground: oklch(0.985 0 0);
|
||||
--sidebar-primary: oklch(0.488 0.243 264.376);
|
||||
--sidebar-primary-foreground: oklch(0.985 0 0);
|
||||
--sidebar-accent: oklch(0.269 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.985 0 0);
|
||||
--sidebar-border: oklch(1 0 0 / 10%);
|
||||
--sidebar-ring: oklch(0.556 0 0);
|
||||
/* ── Light ──────────────────────────────────────────────────────────────── */
|
||||
[data-theme="light"] {
|
||||
color-scheme: light;
|
||||
|
||||
--background: #F6EFEA;
|
||||
--card: #FFFFFF;
|
||||
--card-foreground: #2E2A35;
|
||||
--popover: #FFFFFF;
|
||||
--popover-foreground: #2E2A35;
|
||||
--foreground: #2E2A35;
|
||||
|
||||
--primary: #8B5FBF;
|
||||
--primary-foreground: #FFFFFF;
|
||||
--primary-soft: rgba(139, 95, 191, 0.12);
|
||||
|
||||
--secondary: #E9D7F7;
|
||||
--secondary-foreground: #2E2A35;
|
||||
--muted: #E9D7F7;
|
||||
--muted-foreground: #635B6B;
|
||||
--accent: #E9D7F7;
|
||||
--accent-foreground: #2E2A35;
|
||||
|
||||
--destructive: #BE2C43;
|
||||
--destructive-foreground: #FFFFFF;
|
||||
--destructive-soft: rgba(190, 44, 67, 0.10);
|
||||
|
||||
--border: #DDCFC2;
|
||||
--border-strong: #C4B3A4;
|
||||
--input: #DDCFC2;
|
||||
--ring: #8B5FBF;
|
||||
|
||||
--fg-muted: #635B6B;
|
||||
--fg-subtle: #6E6577;
|
||||
|
||||
--ok: #0C7548;
|
||||
--ok-soft: rgba(12, 117, 72, 0.10);
|
||||
--warn: #8A5A12;
|
||||
--warn-soft: rgba(138, 90, 18, 0.10);
|
||||
--danger: #BE2C43;
|
||||
--danger-soft: rgba(190, 44, 67, 0.10);
|
||||
--info: #8B5FBF;
|
||||
--info-soft: rgba(139, 95, 191, 0.12);
|
||||
--idle: #5A6270;
|
||||
--idle-soft: rgba(90, 98, 112, 0.10);
|
||||
|
||||
--brand-alt: #C9A3E6;
|
||||
--bg-blur: rgba(246, 239, 234, 0.6);
|
||||
--surface-glass: rgba(255, 255, 255, 0.72);
|
||||
--surface-glass-strong: rgba(255, 255, 255, 0.88);
|
||||
--workspace: rgba(255, 255, 255, 0.55);
|
||||
--hairline: rgba(46, 42, 53, 0.06);
|
||||
--wash-a: rgba(139, 95, 191, 0.10);
|
||||
--wash-b: rgba(201, 163, 230, 0.16);
|
||||
--wash-c: rgba(12, 117, 72, 0.05);
|
||||
|
||||
--shadow-sm: 0 1px 2px rgba(46, 42, 53, 0.06);
|
||||
--shadow-md: 0 8px 28px rgba(46, 42, 53, 0.10);
|
||||
--shadow-workspace: 0 24px 70px rgba(46, 42, 53, 0.14);
|
||||
}
|
||||
|
||||
@layer base {
|
||||
* {
|
||||
@apply border-border outline-ring/50;
|
||||
* {
|
||||
@apply border-border outline-ring/50;
|
||||
}
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
@apply font-sans;
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
@apply font-sans;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user