EnergyVenom's picture
Deploy 7831dd1: layout fixes, sidebar folds to icons
f56442a verified
Raw History Blame Contribute Delete
14.6 kB
/* Patchwise design tokens: the one source of truth for colour, type, space, shape, elevation, size, layering and motion.
Every other stylesheet, the Mantine theme (theme.ts) and the Tailwind theme (beui.css) read these variables; none of
them defines its own values. Reference: docs/DESIGN_SYSTEM.md.
1 colour (light, dark, accessibility preferences) 2 scales 3 legacy aliases (older names, kept until Step 4 removes them)
Selectors: Mantine writes its own variables on :root[data-mantine-color-scheme=...] (specificity 0,2,0), so every token
block here uses html:root[data-mantine-color-scheme...] (0,2,1) to win in both schemes. Loaded first (main.tsx). */
/* ------------------------------------------------------------------ 1. colour */
html:root, html:root[data-mantine-color-scheme='light'] {
/* surfaces */
--bg: #ffffff; --bg-base: #fafafa; --bg-elev: #ffffff; --bg-elev-2: #f7f7f8;
--mat-sidebar: rgba(250, 250, 250, 0.9); --mat-bar: rgba(255, 255, 255, 0.86); --mat-pop: rgba(255, 255, 255, 0.78);
--mat-sidebar-solid: #fafafa; --mat-bar-solid: #ffffff; --mat-pop-solid: #ffffff;
--fill: rgba(0, 0, 0, 0.04); --fill-2: rgba(0, 0, 0, 0.07); --fill-3: rgba(0, 0, 0, 0.11);
--sep: #ececee; --sep-strong: #dedee2; --ring: rgba(0, 0, 0, 0.06);
--scrim: rgba(0, 0, 0, 0.28); --hero-a: #2c2c2e; --hero-b: #1d1d1f;
--wash-a: rgba(255, 255, 255, 0.6); --wash-b: rgba(60, 60, 67, 0.05);
--seg-thumb: #ffffff; --chrome-a: #f3f3f5; --chrome-b: #e9e9ed; --chrome-url-bg: #ffffff; --chrome-url-fg: #636366;
/* text: label (primary), label-2 (secondary), label-3 (tertiary); all three are AA (4.5:1) on bg, bg-elev and fill */
--label: #1d1d1f; --label-2: #636366; --label-3: #6e6e73; --ph: #70707a;
/* graphite accent: colour is for status only; the accent is near-black in light and near-white in dark */
--accent: #111113; --accent-hover: #2c2c2e; --accent-press: #000000; --on-accent: #ffffff;
--accent-text: #1d1d1f; --accent-soft: rgba(60, 60, 67, 0.08); --accent-soft-2: rgba(60, 60, 67, 0.14);
--pulse: rgba(60, 60, 67, 0.4); --focus: #1d1d1f; --focus-gap: #ffffff;
/* status: text colour (AA on its soft background), soft background, dot (graphics only, never text) */
--green: #17692d; --green-soft: rgba(52, 199, 89, 0.16); --green-dot: #34c759;
--orange: #8a4a00; --orange-soft: rgba(255, 159, 10, 0.17); --orange-dot: #f59300;
--red: #b8000f; --red-soft: rgba(255, 59, 48, 0.12); --red-dot: #ff3b30;
--orange-line: var(--orange-dot); --red-line: var(--red-dot); --green-line: var(--green-dot);
/* area colours (square marks only, never status): text AA on their soft background */
--blue: #0a5bc4; --blue-soft: rgba(10, 132, 255, 0.14); --violet: #5b33c9; --violet-soft: rgba(124, 77, 255, 0.14); --teal: #00756c; --teal-soft: rgba(0, 166, 153, 0.14);
--status-pass: var(--green-dot); --status-fail: var(--red-dot); --status-wait: var(--orange-dot); --status-idle: #8e8e93;
/* elevation */
--sh-card: 0 0 0 1px var(--sep); /* hairline: surfaces are separated by borders, not shadows */
--sh-pop: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.08), 0 16px 48px rgba(0, 0, 0, 0.18);
--sh-seg: 0 0.5px 1px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
}
html:root[data-mantine-color-scheme='dark'] {
/* surfaces: near-black with a cool cast, in clear steps (sidebar < page < card < raised), like Linear, Vercel, GitHub */
--bg: #0f1012; --bg-base: #0b0c0e; --bg-elev: #16171a; --bg-elev-2: #1c1d21;
--mat-sidebar: rgba(11, 12, 14, 0.92); --mat-bar: rgba(15, 16, 18, 0.88); --mat-pop: rgba(28, 29, 33, 0.96);
--mat-sidebar-solid: #0b0c0e; --mat-bar-solid: #0f1012; --mat-pop-solid: #1c1d21;
/* fills and lines are quiet: white at low opacity, so chips and selected rows never glare */
--fill: rgba(255, 255, 255, 0.05); --fill-2: rgba(255, 255, 255, 0.08); --fill-3: rgba(255, 255, 255, 0.12);
--sep: rgba(255, 255, 255, 0.07); --sep-strong: rgba(255, 255, 255, 0.12); --ring: rgba(255, 255, 255, 0.06);
--scrim: rgba(0, 0, 0, 0.6); --hero-a: #2a2b30; --hero-b: #1f2024; --wash-a: rgba(255, 255, 255, 0.04); --wash-b: rgba(255, 255, 255, 0.02);
--seg-thumb: #2a2b31; --chrome-a: #23242a; --chrome-b: #1c1d22; --chrome-url-bg: #16171a; --chrome-url-fg: #a0a0a8;
/* text: off-white, then two greys; all AA on the page and on cards */
--label: #ececef; --label-2: #a1a1aa; --label-3: #8c8c96; --ph: #7c7c86;
--accent: #ececef; --accent-hover: #ffffff; --accent-press: #d4d4d8; --on-accent: #111113; --accent-text: #ececef;
--accent-soft: rgba(255, 255, 255, 0.06); --accent-soft-2: rgba(255, 255, 255, 0.10); --pulse: rgba(255, 255, 255, 0.35);
--focus: #ececef; --focus-gap: #0f1012;
/* status: softer hues for text, tinted fills; the dot keeps full strength for small marks */
--green: #5bd087; --green-soft: rgba(74, 222, 128, 0.10); --green-dot: #3fbf6f;
--orange: #f2b45a; --orange-soft: rgba(245, 166, 35, 0.10); --orange-dot: #e9a23b;
--red: #f58b85; --red-soft: rgba(248, 113, 113, 0.10); --red-dot: #ef5f57;
--blue: #8bb8f8; --blue-soft: rgba(96, 165, 250, 0.12); --violet: #b8a6f5; --violet-soft: rgba(167, 139, 250, 0.12);
--teal: #6fd3c6; --teal-soft: rgba(45, 212, 191, 0.12);
--status-idle: #7c7c86;
/* outlines of a waiting, failed or passed card: the status hue, muted, so a card is marked without glowing */
--orange-line: rgba(233, 162, 59, 0.45); --red-line: rgba(239, 95, 87, 0.5); --green-line: rgba(63, 191, 111, 0.45);
--sh-card: 0 0 0 1px var(--sep);
--sh-pop: 0 0 0 0.5px rgba(255, 255, 255, 0.14), 0 2px 6px rgba(0, 0, 0, 0.4), 0 20px 56px rgba(0, 0, 0, 0.6);
--sh-seg: 0 0.5px 1px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
}
/* accessibility preferences (after the scheme blocks, same specificity: these win in both schemes) */
@media (prefers-reduced-transparency: reduce) {
html:root, html:root[data-mantine-color-scheme] { --mat-sidebar: var(--mat-sidebar-solid); --mat-bar: var(--mat-bar-solid); --mat-pop: var(--mat-pop-solid); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
html:root, html:root[data-mantine-color-scheme] { --mat-sidebar: var(--mat-sidebar-solid); --mat-bar: var(--mat-bar-solid); --mat-pop: var(--mat-pop-solid); }
}
@media (prefers-contrast: more) {
html:root, html:root[data-mantine-color-scheme='light'] { --sep: var(--sep-strong); --label-2: #48484a; --label-3: #545458; --mat-sidebar: var(--mat-sidebar-solid); --mat-bar: var(--mat-bar-solid); --mat-pop: var(--mat-pop-solid); }
html:root[data-mantine-color-scheme='dark'] { --sep: var(--sep-strong); --label-2: #d1d1d6; --label-3: #c7c7cc; --mat-sidebar: var(--mat-sidebar-solid); --mat-bar: var(--mat-bar-solid); --mat-pop: var(--mat-pop-solid); }
}
/* ------------------------------------------------------------------ 2. scales (the same in both schemes) */
html:root {
/* type family */
--font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter Variable", system-ui, "Segoe UI", sans-serif;
--mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
/* display mono: UI chrome (nav, labels, table headers, buttons, status tags, page titles); reading text stays --font */
--font-display-mono: "Geist Mono Variable", ui-monospace, "SF Mono", Menlo, monospace;
--ls-mono-caps: 0.06em;
--fs-label: 11px; --lh-label: 14px;
/* type scale: size / line height pairs; use them together (font: var(--fs-sm)/var(--lh-sm) var(--font) or the .t-* classes) */
--fs-2xs: 11px; --lh-2xs: 14px; /* badges, counters, all-caps labels */
--fs-xs: 12px; --lh-xs: 16px; /* captions, meta, table footnotes */
--fs-sm: 13px; --lh-sm: 18px; /* secondary text, dense tables, controls */
--fs-base: 14px; --lh-base: 20px; /* body text, form fields (the default) */
--fs-md: 15px; --lh-md: 22px; /* reading text: explanations, chat messages */
--fs-lg: 17px; --lh-lg: 24px; /* card and section titles */
--fs-xl: 20px; --lh-xl: 26px; /* dialog titles, sub-page titles */
--fs-2xl: 24px; --lh-2xl: 30px; /* section headings on long pages */
--fs-3xl: 28px; --lh-3xl: 34px; /* page titles (h1) */
--fs-4xl: 34px; --lh-4xl: 40px; /* hero numbers and hero headings */
--fs-display: 52px; --lh-display: 54px; /* sign-in headline only */
/* weights: regular, medium (labels, nav), semibold (emphasis, buttons, titles), bold (page titles and hero only) */
--fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 650;
/* tracking: tighter as text grows */
--ls-body: -0.006em; --ls-title: -0.016em; --ls-display: -0.03em; --ls-caps: 0.04em;
/* space: a 4px grid; components use these steps only */
--sp-0: 0; --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
--sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;
/* radius: small parts, controls, cards, sheets and heroes, pills */
--r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-pill: 999px;
/* decorative hatched strips that frame panels (used by .pw-hatch / .pw-hatch-diag) */
--hatch: repeating-linear-gradient(90deg, var(--sep-strong) 0 1px, transparent 1px 5px);
--hatch-diag: repeating-linear-gradient(135deg, var(--sep-strong) 0 1px, transparent 1px 6px);
/* control heights: compact (inside tables and chips), small, default, large (sign-in, hero actions) */
--h-2xs: 24px; --h-xs: 28px; --h-sm: 32px; --h-md: 40px; --h-lg: 48px;
/* layout: page gutters and content widths; breakpoints are 640 / 768 / 1024 / 1280 (see DESIGN_SYSTEM.md, media
queries cannot read variables) */
--gutter: 16px; --w-form: 480px; --w-reading: 720px; --w-content: 1200px; --w-wide: 1440px;
--sidebar-w: 264px; --panel-w: 440px; --topbar-h: 56px;
/* layering */
--z-base: 0; --z-raised: 1; --z-sticky: 10; --z-sidebar: 100; --z-drawer: 200; --z-popover: 300; --z-modal: 400; --z-toast: 500;
/* motion: functional only; reduced motion makes every duration 1ms (apple.css section 3) */
--ease: cubic-bezier(0.22, 1, 0.36, 1); --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1); --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
--d1: 120ms; --d2: 200ms; --d3: 320ms;
}
@media (min-width: 768px) { html:root { --gutter: 24px; } }
@media (min-width: 1280px) { html:root { --gutter: 32px; } }
/* ------------------------------------------------------------------ 3. legacy aliases (no new use; Step 4 removes them page by page) */
html:root, html:root[data-mantine-color-scheme] {
--r-xs: var(--r-sm); --r-2xl: var(--r-xl);
--fpt-font: var(--font); --fpt-font-display: var(--font); --fpt-mono: var(--mono);
--fpt-page: var(--bg); --fpt-sidebar: var(--bg-base);
--fpt-surface: var(--bg-elev); --fpt-surface-2: var(--fill);
--fpt-border: var(--sep); --fpt-line: var(--sep-strong);
--fpt-text: var(--label); --fpt-dim: var(--label-2); --fpt-disabled: var(--label-3);
--fpt-accent: var(--accent-text); --fpt-accent-hover: var(--accent-hover); --fpt-accent-pressed: var(--accent-press); --fpt-accent-text: var(--on-accent);
--fpt-ink: var(--accent); --fpt-ink-text: var(--on-accent);
--fpt-selected: var(--fill-2); --fpt-hover: var(--fill);
--fpt-focus: var(--focus); --fpt-focus-inner: var(--bg-elev);
--fpt-status-running: var(--accent); --fpt-status-waiting: var(--status-wait); --fpt-status-done: var(--status-pass);
--fpt-status-failed: var(--status-fail); --fpt-status-idle: var(--label-3);
--fpt-env-practice-bg: var(--orange-soft); --fpt-env-practice-fg: var(--orange);
--fpt-env-fusion-bg: transparent; --fpt-env-fusion-fg: var(--label);
--fpt-shadow-1: var(--sh-card); --fpt-shadow-2: var(--sh-pop); --fpt-shadow-3: var(--sh-pop);
--fpt-radius-control: var(--r-md); --fpt-radius-card: var(--r-lg);
--fpt-ease: var(--ease); --fpt-dur-1: var(--d1); --fpt-dur-2: var(--d2); --fpt-dur-3: var(--d3);
--fpt-band: transparent; --fpt-mint-card: transparent; --fpt-lav-card: transparent;
--pill-neutral-bg: var(--fill); --pill-neutral-fg: var(--label-2);
--pill-green-bg: var(--green-soft); --pill-green-fg: var(--green);
--pill-amber-bg: var(--orange-soft); --pill-amber-fg: var(--orange);
--pill-red-bg: var(--red-soft); --pill-red-fg: var(--red);
--pill-ink-bg: var(--fill-2); --pill-ink-fg: var(--label);
--pill-mint-bg: var(--fill); --pill-mint-fg: var(--label-2); --pill-lav-bg: var(--fill); --pill-lav-fg: var(--label-2);
/* Mantine's own variables, from the tokens (this block's specificity beats MantineProvider's in both schemes) */
--mantine-color-default: var(--fill); --mantine-color-default-hover: var(--fill-2); --mantine-color-default-color: var(--label); --mantine-color-default-border: transparent;
--mantine-color-anchor: var(--accent-text);
--mantine-primary-color-filled: var(--accent); --mantine-primary-color-filled-hover: var(--accent-hover); --mantine-primary-color-contrast: var(--on-accent);
--mantine-primary-color-light: var(--accent-soft); --mantine-primary-color-light-hover: var(--accent-soft-2); --mantine-primary-color-light-color: var(--label);
--mantine-color-blue-filled: var(--accent); --mantine-color-blue-light: var(--fill); --mantine-color-blue-light-color: var(--label);
--mantine-color-dimmed: var(--label-2); --mantine-color-text: var(--label); --mantine-color-body: var(--bg-elev);
--mantine-color-placeholder: var(--ph); --mantine-color-error: var(--red);
--mantine-shadow-xs: none; --mantine-shadow-sm: var(--sh-card); --mantine-shadow-md: var(--sh-card); --mantine-shadow-lg: var(--sh-pop); --mantine-shadow-xl: var(--sh-pop);
--mantine-font-family: var(--font); --mantine-font-family-headings: var(--font); --mantine-font-family-monospace: var(--mono);
--mantine-font-weight-bold: var(--fw-bold);
/* Mantine control sizes on the height scale */
--button-height-xs: var(--h-sm); --button-height-sm: var(--h-sm); --button-height-md: var(--h-md); --button-height-lg: var(--h-lg);
--button-height-compact-xs: var(--h-2xs); --button-height-compact-sm: var(--h-xs); --button-height-compact-md: var(--h-sm);
--button-padding-x-xs: 14px; --button-padding-x-sm: 14px; --button-padding-x-md: var(--sp-5);
--button-padding-x-compact-xs: var(--sp-2); --button-padding-x-compact-sm: var(--sp-2);
--input-height-xs: var(--h-sm); --input-height-sm: var(--h-md); --input-height-md: var(--h-lg);
}