feat(ui): design-system v2 tokens (green/warm/dark-first) #9

Merged
cesnimda merged 1 commits from feature/design-tokens into develop 2026-07-01 20:01:43 +02:00
4 changed files with 108 additions and 71 deletions
+2 -2
View File
@@ -9,8 +9,8 @@
// Apply the saved theme before first paint to avoid a flash of the wrong mode.
(function () {
try {
var t = localStorage.getItem('ii:theme');
if (!t) t = matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
// Dark-first: default new users to dark unless they've chosen light.
var t = localStorage.getItem('ii:theme') || 'dark';
if (t === 'dark') document.documentElement.classList.add('dark');
} catch (e) {}
})();
+38 -28
View File
@@ -8,46 +8,55 @@
two variables at runtime. See docs/specs/ui-overhaul.md.
*/
@layer base {
/*
Design tokens — v2 (per docs/discovery/04). Dark-first, warm-leaning neutrals,
green brand accent derived from #3ba31f. Light is a genuine white (not grey).
Green is never the SOLE state signal (pair with icon/shape) — colour-blind-safe
by construction. Values are HSL triples (space-separated) for Tailwind's
`hsl(var(--x) / <alpha-value>)` mapping.
*/
:root {
/* Neutrals — warm-tinted slate (Notion-ish paper) */
/* Light — genuine white, warm off-white surfaces */
--background: 0 0% 100%;
--foreground: 222 22% 12%;
--card: 0 0% 100%;
--muted: 220 16% 96%;
--muted-foreground: 220 9% 46%;
--border: 220 16% 90%;
--input: 220 16% 90%;
--ring: 245 75% 60%;
--foreground: 30 10% 12%;
--card: 40 33% 99%;
--muted: 40 24% 96%;
--muted-foreground: 35 8% 42%;
--border: 38 18% 89%;
--input: 38 18% 89%;
--ring: 110 62% 38%;
/* Brand accent — Indigo #5b5bf0 */
--primary: 245 75% 59%;
/* Brand accent — green (from #3ba31f), darkened for AA white-on-green */
--primary: 110 62% 33%;
--primary-foreground: 0 0% 100%;
/* Semantic */
--success: 152 56% 40%;
--warning: 38 92% 50%;
--danger: 0 72% 51%;
--success: 145 55% 38%;
--warning: 38 92% 45%;
--danger: 4 74% 50%;
--danger-foreground: 0 0% 100%;
--radius: 0.625rem;
--radius: 0.5rem; /* lg 8px · md 6px · sm 4px */
}
.dark {
--background: 224 32% 9%;
--foreground: 220 18% 92%;
--card: 224 28% 12%;
--muted: 223 22% 17%;
--muted-foreground: 220 12% 64%;
--border: 223 20% 20%;
--input: 223 20% 22%;
--ring: 245 80% 66%;
/* Dark (default) — warm charcoal layers, NOT pure black */
--background: 30 7% 10%;
--foreground: 40 22% 93%;
--card: 30 7% 13%;
--muted: 30 6% 17%;
--muted-foreground: 35 9% 64%;
--border: 30 7% 22%;
--input: 30 7% 24%;
--ring: 110 50% 46%;
--primary: 245 80% 67%;
--primary-foreground: 224 32% 9%;
/* Brand accent — luminous green for dark surfaces */
--primary: 110 52% 42%;
--primary-foreground: 0 0% 100%;
--success: 152 50% 50%;
--warning: 38 92% 58%;
--danger: 0 70% 60%;
--success: 145 50% 48%;
--warning: 38 90% 56%;
--danger: 4 72% 58%;
--danger-foreground: 0 0% 100%;
}
@@ -57,7 +66,8 @@
body {
@apply bg-background text-foreground antialiased;
font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
/* Prefer Inter when available (bundled in a later slice); graceful system fallback. */
font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
Helvetica, Arial, sans-serif;
}
+43 -41
View File
@@ -1,18 +1,20 @@
:root {
--bg: #0f1420;
--panel: #1a2030;
--panel-2: #222a3d;
--text: #e6e9f0;
--muted: #8b93a7;
--accent: #4f8cff;
--danger: #eb5757;
--ok: #6fcf97;
/* v2 brand — warm charcoal + green (aligns with the token system in index.css).
Legacy classes still read these; the v2 shell/components use the token system. */
--bg: #1a1917;
--panel: #211f1d;
--panel-2: #2a2724;
--text: #f2efe9;
--muted: #a8a29a;
--accent: #46ad27;
--danger: #d95a4a;
--ok: #5bbf4a;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--text); }
.topbar { display: flex; align-items: center; gap: 18px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid #2c3550; }
.topbar { display: flex; align-items: center; gap: 18px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid #332f2b; }
.brand { font-weight: 700; font-size: 18px; }
.topbar nav a { color: var(--muted); text-decoration: none; margin-right: 14px; }
.topbar nav a.active, .topbar nav a:hover { color: var(--text); }
@@ -21,13 +23,13 @@ body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-
/* ── Search bar ── */
.search-form { display: flex; align-items: center; gap: 0; flex: 1; max-width: 420px; }
.search-input {
flex: 1; background: var(--panel-2); border: 1px solid #2c3550; border-right: none;
flex: 1; background: var(--panel-2); border: 1px solid #332f2b; border-right: none;
color: var(--text); border-radius: 6px 0 0 6px; padding: 7px 10px; font-size: 13px;
min-width: 0;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-btn {
background: var(--panel-2); border: 1px solid #2c3550; border-left: none;
background: var(--panel-2); border: 1px solid #332f2b; border-left: none;
color: var(--muted); border-radius: 0 6px 6px 0; padding: 7px 10px; cursor: pointer; font-size: 13px;
}
.search-btn:hover { color: var(--text); border-color: var(--accent); }
@@ -38,7 +40,7 @@ body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-
.sidebar {
width: 216px; flex-shrink: 0;
background: var(--panel); border-right: 1px solid #2c3550;
background: var(--panel); border-right: 1px solid #332f2b;
display: flex; flex-direction: column; overflow-y: auto;
transition: width 0.2s ease;
}
@@ -47,7 +49,7 @@ body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-
.sidebar-header {
display: flex; align-items: center; justify-content: space-between;
padding: 12px 8px 10px;
border-bottom: 1px solid #2c3550;
border-bottom: 1px solid #332f2b;
min-height: 42px; flex-shrink: 0;
}
.sidebar-brand { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding-left: 6px; }
@@ -57,7 +59,7 @@ body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-
/* Section headings */
.section-head {
display: flex; align-items: center; justify-content: space-between;
width: 100%; background: none; border: none; border-bottom: 1px solid #2c3550;
width: 100%; background: none; border: none; border-bottom: 1px solid #332f2b;
padding: 7px 10px 7px 12px; cursor: pointer;
color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
}
@@ -87,7 +89,7 @@ body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-
background: var(--panel-2); border-radius: 8px; padding: 1px 5px;
flex-shrink: 0;
}
.folder-item--active .folder-badge { background: #2c3550; color: var(--accent); }
.folder-item--active .folder-badge { background: #332f2b; color: var(--accent); }
/* Favorite pin/unpin button */
.fav-pin {
@@ -108,7 +110,7 @@ button:disabled { opacity: 0.5; cursor: default; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.widget-toggles { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.grid-item { background: var(--panel); border: 1px solid #2c3550; border-radius: 10px; overflow: hidden; }
.grid-item { background: var(--panel); border: 1px solid #332f2b; border-radius: 10px; overflow: hidden; }
.widget { padding: 14px; height: 100%; display: flex; flex-direction: column; }
.widget h3 { margin: 0 0 10px; font-size: 14px; cursor: move; }
.widget--link { cursor: pointer; }
@@ -131,7 +133,7 @@ button:disabled { opacity: 0.5; cursor: default; }
table.mini, table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.mini td { padding: 3px 0; }
table.grid th, table.grid td { padding: 8px; border-bottom: 1px solid #2c3550; text-align: left; }
table.grid th, table.grid td { padding: 8px; border-bottom: 1px solid #332f2b; text-align: left; }
.num { text-align: right; }
.muted { color: var(--muted); font-size: 12px; }
@@ -172,7 +174,7 @@ table.grid th, table.grid td { padding: 8px; border-bottom: 1px solid #2c3550; t
.sl-panel {
display: flex;
flex-direction: column;
border-right: 1px solid #2c3550;
border-right: 1px solid #332f2b;
overflow: hidden;
}
.sl-search-wrap { padding: 10px 12px 6px; }
@@ -180,7 +182,7 @@ table.grid th, table.grid td { padding: 8px; border-bottom: 1px solid #2c3550; t
width: 100%;
box-sizing: border-box;
background: var(--panel-2);
border: 1px solid #2c3550;
border: 1px solid #332f2b;
color: var(--text);
border-radius: 6px;
padding: 7px 10px;
@@ -191,7 +193,7 @@ table.grid th, table.grid td { padding: 8px; border-bottom: 1px solid #2c3550; t
.sl-item {
display: block; width: 100%; text-align: left;
background: none; border: none; cursor: pointer;
padding: 10px 14px; border-bottom: 1px solid #1e2540;
padding: 10px 14px; border-bottom: 1px solid #26231f;
color: var(--text);
}
.sl-item:hover { background: var(--panel-2); }
@@ -211,7 +213,7 @@ table.grid th, table.grid td { padding: 8px; border-bottom: 1px solid #2c3550; t
}
.sd-panel-header {
padding: 16px 20px 12px;
border-bottom: 1px solid #2c3550;
border-bottom: 1px solid #332f2b;
background: var(--panel);
position: sticky; top: 0; z-index: 1;
}
@@ -223,7 +225,7 @@ table.grid th, table.grid td { padding: 8px; border-bottom: 1px solid #2c3550; t
.sd-detail { padding: 20px; max-width: 760px; }
.sd-back {
display: inline-flex; align-items: center; gap: 4px;
background: none; border: 1px solid #2c3550; border-radius: 6px;
background: none; border: 1px solid #332f2b; border-radius: 6px;
color: var(--text); font-size: 13px; cursor: pointer;
padding: 5px 12px; margin-bottom: 18px;
}
@@ -232,9 +234,9 @@ table.grid th, table.grid td { padding: 8px; border-bottom: 1px solid #2c3550; t
.sd-detail-subject { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.sd-detail-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sd-detail-sep { opacity: 0.4; }
.sd-snippet { background: var(--panel); border: 1px solid #2c3550; border-radius: 8px; padding: 14px 16px; font-size: 13px; line-height: 1.6; color: var(--muted); white-space: pre-wrap; margin-bottom: 18px; }
.sd-snippet { background: var(--panel); border: 1px solid #332f2b; border-radius: 8px; padding: 14px 16px; font-size: 13px; line-height: 1.6; color: var(--muted); white-space: pre-wrap; margin-bottom: 18px; }
.sd-ai-summary { margin-bottom: 14px; }
.sd-ai-summary-text { background: var(--panel-2); border: 1px solid #2c3550; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--text); }
.sd-ai-summary-text { background: var(--panel-2); border: 1px solid #332f2b; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--text); }
.sd-detail-actions { display: flex; gap: 10px; }
.btn-sm {
background: var(--accent); color: #fff; border: none; border-radius: 6px;
@@ -245,8 +247,8 @@ table.grid th, table.grid td { padding: 8px; border-bottom: 1px solid #2c3550; t
.page { max-width: 900px; }
.form-row { display: flex; gap: 10px; margin: 14px 0; }
.form-row input { flex: 1; }
input, select { background: var(--panel-2); border: 1px solid #2c3550; color: var(--text); border-radius: 6px; padding: 8px; }
.card { background: var(--panel); border: 1px solid #2c3550; border-radius: 10px; padding: 14px; margin-top: 12px; }
input, select { background: var(--panel-2); border: 1px solid #332f2b; color: var(--text); border-radius: 6px; padding: 8px; }
.card { background: var(--panel); border: 1px solid #332f2b; border-radius: 10px; padding: 14px; margin-top: 12px; }
.card.success { border-color: var(--ok); }
.card ul { font-size: 13px; color: var(--muted); }
@@ -259,14 +261,14 @@ input, select { background: var(--panel-2); border: 1px solid #2c3550; color: va
/* ── Shared buttons ── */
.brand-link { text-decoration: none; color: var(--text); display: inline-flex; }
.ghost { background: transparent; border: 1px solid #36405c; color: var(--text); }
.ghost { background: transparent; border: 1px solid #3d3833; color: var(--text); }
.ghost:hover { border-color: var(--accent); }
.cta {
background: var(--accent); color: #fff; border: none; border-radius: 8px;
padding: 12px 22px; font-size: 16px; font-weight: 700; cursor: pointer;
text-decoration: none; display: inline-block;
}
.cta:hover { background: #5d97ff; }
.cta:hover { background: #57c231; }
/* ── Landing page ── */
.landing { max-width: 1080px; margin: 0 auto; padding: 0 20px 60px; }
@@ -277,13 +279,13 @@ input, select { background: var(--panel-2); border: 1px solid #2c3550; color: va
.hero-cta { margin: 8px 0; }
.fineprint { color: var(--muted); font-size: 12px; margin-top: 14px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 24px; }
.feature { background: var(--panel); border: 1px solid #2c3550; border-radius: 12px; padding: 20px; }
.feature { background: var(--panel); border: 1px solid #332f2b; border-radius: 12px; padding: 20px; }
.feature-icon { font-size: 26px; }
.feature h3 { margin: 10px 0 6px; font-size: 17px; }
.feature p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0; }
.closing { text-align: center; margin: 56px 0 20px; }
.closing h2 { font-size: 28px; margin-bottom: 18px; }
.landing-footer { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid #2c3550; }
.landing-footer { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid #332f2b; }
/* ── Folder view ── */
.folder-view { max-width: 960px; }
@@ -294,7 +296,7 @@ input, select { background: var(--panel-2); border: 1px solid #2c3550; color: va
.fv-error { color: var(--danger); font-size: 14px; padding: 12px 0; }
.email-list { width: 100%; border-collapse: collapse; font-size: 13px; }
.email-row { border-bottom: 1px solid #2c3550; cursor: pointer; }
.email-row { border-bottom: 1px solid #332f2b; cursor: pointer; }
.email-row:hover { background: var(--panel); }
.email-row--unread .el-sender,
.email-row--unread .el-subj-text { font-weight: 700; color: var(--text); }
@@ -337,7 +339,7 @@ input, select { background: var(--panel-2); border: 1px solid #2c3550; color: va
.splash-card { text-align: center; max-width: 440px; padding: 32px; }
.splash-card h2 { margin: 16px 0 6px; }
.progress-track { height: 10px; background: var(--panel-2); border-radius: 6px; overflow: hidden; margin: 20px 0 10px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #4f8cff, #6fcf97); border-radius: 6px; transition: width 0.4s ease; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #46ad27, #6fcf97); border-radius: 6px; transition: width 0.4s ease; }
.progress-fill[data-indeterminate="true"] { animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.progress-label { color: var(--muted); font-size: 13px; }
@@ -348,7 +350,7 @@ input, select { background: var(--panel-2); border: 1px solid #2c3550; color: va
.sync-label--err { color: var(--danger); }
.sync-spinner {
width: 10px; height: 10px; border-radius: 50%;
border: 2px solid #36405c; border-top-color: var(--accent);
border: 2px solid #3d3833; border-top-color: var(--accent);
animation: sync-spin 0.7s linear infinite;
}
@keyframes sync-spin { to { transform: rotate(360deg); } }
@@ -358,7 +360,7 @@ input, select { background: var(--panel-2); border: 1px solid #2c3550; color: va
/* ── Email detail body (Senders page) ──────────────────────────────────── */
.sd-body-loading { padding: 8px 0 18px; }
.sd-body {
background: var(--panel); border: 1px solid #2c3550; border-radius: 8px;
background: var(--panel); border: 1px solid #332f2b; border-radius: 8px;
padding: 16px 18px; font-size: 13px; line-height: 1.7; color: var(--text);
white-space: pre-wrap; word-break: break-word; margin-bottom: 18px;
max-height: 60vh; overflow-y: auto;
@@ -369,7 +371,7 @@ input, select { background: var(--panel-2); border: 1px solid #2c3550; color: va
.unsub-toast { color: var(--ok); font-size: 13px; margin-left: 6px; }
.unsub-tabs { display: flex; gap: 6px; margin: 16px 0 10px; }
.unsub-tab {
background: var(--panel); border: 1px solid #2c3550; color: var(--muted);
background: var(--panel); border: 1px solid #332f2b; color: var(--muted);
border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer;
display: flex; align-items: center; gap: 6px;
}
@@ -377,7 +379,7 @@ input, select { background: var(--panel-2); border: 1px solid #2c3550; color: va
.unsub-tab--active { color: var(--text); border-color: var(--accent); background: var(--panel-2); }
.unsub-tab-count { font-size: 11px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 1px 6px; }
.unsub-grid { width: 100%; }
.unsub-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; border: 1px solid #36405c; }
.unsub-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; border: 1px solid #3d3833; }
.unsub-badge--detected { color: var(--muted); }
.unsub-badge--queued { color: #f2c94c; border-color: #f2c94c66; }
.unsub-badge--progress { color: var(--accent); border-color: var(--accent); }
@@ -392,13 +394,13 @@ input, select { background: var(--panel-2); border: 1px solid #2c3550; color: va
/* ── Bulk selection toolbar (folder/search/sender email lists) ──────────── */
.bulk-toolbar {
display: flex; align-items: center; gap: 10px;
background: var(--panel-2); border: 1px solid #2c3550; border-radius: 8px;
background: var(--panel-2); border: 1px solid #332f2b; border-radius: 8px;
padding: 8px 14px; margin-bottom: 10px; font-size: 13px;
}
.bulk-toolbar .muted { font-size: 12px; }
.bulk-toolbar-spacer { flex: 1; }
.bulk-btn {
background: var(--panel); border: 1px solid #2c3550; color: var(--text);
background: var(--panel); border: 1px solid #332f2b; color: var(--text);
border-radius: 6px; padding: 5px 12px; font-size: 12px; cursor: pointer;
}
.bulk-btn:hover { border-color: var(--accent); }
@@ -406,13 +408,13 @@ input, select { background: var(--panel-2); border: 1px solid #2c3550; color: va
.el-select { width: 28px; text-align: center; }
/* ── Keyboard shortcut help ──────────────────────────────────────────────── */
.kbd-hint { position: fixed; bottom: 14px; right: 14px; font-size: 11px; color: var(--muted); background: var(--panel); border: 1px solid #2c3550; border-radius: 6px; padding: 4px 10px; opacity: 0.7; }
.kbd-hint kbd { background: var(--panel-2); border: 1px solid #36405c; border-radius: 3px; padding: 0 4px; font-family: inherit; }
.kbd-hint { position: fixed; bottom: 14px; right: 14px; font-size: 11px; color: var(--muted); background: var(--panel); border: 1px solid #332f2b; border-radius: 6px; padding: 4px 10px; opacity: 0.7; }
.kbd-hint kbd { background: var(--panel-2); border: 1px solid #3d3833; border-radius: 3px; padding: 0 4px; font-family: inherit; }
/* ── Saved searches ─────────────────────────────────────────────────────── */
.saved-search-row { display: flex; align-items: center; gap: 8px; }
.saved-search-save-btn {
background: none; border: 1px solid #2c3550; color: var(--muted);
background: none; border: 1px solid #332f2b; color: var(--muted);
border-radius: 6px; padding: 6px 10px; font-size: 12px; cursor: pointer;
}
.saved-search-save-btn:hover { color: var(--text); border-color: var(--accent); }
+25
View File
@@ -31,6 +31,31 @@ export default {
DEFAULT: 'hsl(var(--danger) / <alpha-value>)',
foreground: 'hsl(var(--danger-foreground) / <alpha-value>)',
},
// Static brand ramp (from #3ba31f) for utility use (bg-green-500, etc.).
// The theme-aware accent above (`primary`) is what most UI should use.
green: {
50: '#f1f9ec',
100: '#dcf0d0',
200: '#bde3ab',
300: '#93d07d',
400: '#63b84a',
500: '#3ba31f',
600: '#2f8419',
700: '#266a15',
800: '#1e5312',
900: '#163a0e',
},
},
fontFamily: {
sans: [
'Inter',
'ui-sans-serif',
'system-ui',
'-apple-system',
'Segoe UI',
'Roboto',
'sans-serif',
],
},
borderRadius: {
lg: 'var(--radius)',