Files
openmotion/library/design/systems/github/tokens.css
Tom Huang ef577a7844 feat(design): integrate Open Design HTML workflows, MCP tools, and Design Studio editor (#699)
* feat(design): add Design Studio project contract and locale resources

* feat(design): port Open Design templates, systems, skills, craft and scenario guides

* feat(design): add shared design-projects service, HTTP adapter, 4 MCP tools and openmotion-design Skill

* feat(design): add Design Studio HTML preview editor, scene tabs, Explore and MCP handbook entries

* feat(design): polish Design Studio UI, live preview bridge, packaging and stdio MCP E2E tests

- Upgrade Design Studio visual design: editorial hero and elevated composer dock with Design System swatches, Design Skill picker, and example prompt pills; edge-to-edge ScaledPreviewThumb gallery cards; dot-grid device frame canvas with dimension captions; syntax-highlighted line-numbered CodeViewer; inline project rename and Open-in actions; symmetrical 8-card Explore template shelf
- Keep preview bridge mounted for live HTML previews without iframe reloads on tool toggle, prevent overlay pointer capture from swallowing annotation popover clicks, and eliminate redundant initial raw preview fetches
- Complete all 10 non-English locale dictionaries in design-ui.json and design-editor-ui.json
- Register library/design and docs/design-studio.md in distribution packaging, include openmotion-design in package Skill checks, exercise all 4 openmotion_design_* tools in phase1-package.mjs, and schedule design test suites in CI
- Add live stdio MCP subprocess E2E coverage and CodeViewer/DesignProjectList Vitest coverage

* chore(design): remove redundant More studios dropdown from DesignSceneTabs

* feat(design): add Mobile App scenario with 390x844 phone preview default

* perf(design): freeze idle rAF/WebGL/CSS animations in preview thumbs and unmount offscreen iframes

* feat(design): reuse Motion Brand Kits for Design Studio picker with hover preview and detail modal

* feat(design): add Motion-aligned Design template detail preview modal with responsive stage and navigation

* feat(design): support @ mention autocomplete and composable multi-select templates, skills and prompts in composer

* fix(design): unify studio bar tab heights to eliminate layout shift between image and design scenes

* fix(design): keep Design Studio sub-navigation bar on a single responsive row

* feat(design): move Design Studio composer to floating bottom dock with scrollable middle template gallery

* chore(design): assign dedicated mobile-app templates from Open Design catalog without overlap with prototype

* feat(design): curate flagship-first template ordering and clean gallery-first card styling

* fix(design): constrain BrandKitPicker popover max-width and scroll container height to prevent overflow

* fix(design): align active scene tab styling with Text-to-Image and match search input and button heights

* fix(design): center editor toolbar with 3-column grid and remove idle pill background on annotation tools

* refactor(design): move Preview/Code and viewport selector into canvas toolbar and use compact annotation icons

* fix(design): remove inner textarea focus ring and align composer border radii

* fix(design): match filter input height to 32px md Button height

* fix(design): eliminate leaked media-surface border on composer textarea and align template detail stage with Motion

* docs(design): include mobile-app in Design Studio scenario documentation

* feat(design): make Copy to Agent prompts self-contained with MCP install and live workspace setup

* fix(design): replace opaque region fill with crisp translucent marquee and smart popover placement

* fix(design): remove internal-link demo URL and duplicate i18n keys that overwrote Studio translations

* feat(design): keep drawn pen strokes visible during compose, add visual previews in annotations, and focus on click

* fix(design): make toolbar Comments counter button toggle the Comments panel with active state

* fix(design): auto-size project title input and remove leaked media-surface fill and gap

* test(design): pass anchor in phase1 package comment smoke and target platform-export scenario by data attribute

* fix(design): address PR review findings on entry restore, preview isolation, coordinates, save revisions, and icons

* fix(design): reject overlapping write/delete paths, enable conflict overwrite retry, and hoist optional annotation bindings

* fix(design): fetch latest project and file before rebasing discarded code draft

* fix(design): clear codeLoading in finally when discard reload fails

---------

Co-authored-by: pftom <pftom@pftomdeMacBook-Pro.local>
Co-authored-by: pftom <pftom@pftomdeMBP.lan>
Co-authored-by: pftom <pftom@Mac.lan>
2026-11-20 14:38:40 +08:00

126 lines
7.6 KiB
CSS

/* ─────────────────────────────────────────────────────────────────────────
* design-systems/github/tokens.css
*
* Structured token bindings for the "GitHub" brand — Primer foundations,
* functional density, blue-on-white precision.
*
* Brand identity in three sentences:
* 1. True white canvas (#ffffff) with a clean canvas-subtle (#f6f8fa)
* secondary surface; hairline borders (#d0d7de) define every pane
* — density over decoration, information over aesthetics.
* 2. System-ui stack throughout — no custom webfont; type renders at
* instant on every OS; 14px body (not 16px) is the identity.
* 3. Primer blue (#0969da) for all interactive affordances; GitHub
* green (#1a7f37) reserved for success/merge states only.
*
* Schema decisions:
* - --bg: #ffffff; --surface: #f6f8fa (canvas-subtle).
* - --surface-warm aliases --surface (no warm tier in Primer).
* - --fg: #1f2328 (fg-default); --muted: #656d76 (fg-muted).
* - --border: #d0d7de (1px hairline — the structural backbone).
* - --accent: #0969da (Primer Blue); --accent-hover: #0550ae.
* - --success bound to GitHub green (#1a7f37) — merge / open state.
* - --tracking-display: -0.01em (only display-size headings use it).
* - --text-base: 14px (the 14px body IS GitHub's product density).
* - --radius-sm: 6px (universal Primer radius for buttons/inputs).
* ─────────────────────────────────────────────────────────────────── */
:root {
/* ─── Surface ──────────────────────────────────────────────────── */
--bg: #ffffff;
--surface: #f6f8fa; /* canvas-subtle — sidebar, input bg */
--surface-warm: var(--surface); /* Primer has no warm tier */
/* ─── Foreground ───────────────────────────────────────────────── */
--fg: #1f2328; /* fg-default — ink */
--fg-2: #1f2328; /* same ink; no B-slot split in Primer */
--muted: #656d76; /* fg-muted — captions, file paths */
--meta: #656d76; /* same muted tier */
/* ─── Border ───────────────────────────────────────────────────── */
--border: #d0d7de; /* border-default — hairline structural */
--border-soft: #d8dee4; /* border-muted — inner panel dividers */
/* ─── Accent ───────────────────────────────────────────────────── */
--accent: #0969da; /* Primer Blue — links, primary CTAs */
--accent-on: #ffffff;
--accent-hover: #0550ae; /* darker pressed state */
--accent-active: color-mix(in oklab, var(--accent), black 14%);
/* ─── Semantic ─────────────────────────────────────────────────── */
--success: #1a7f37; /* GitHub green — merge, open, success */
--warn: #9a6700; /* attention amber text */
--danger: #cf222e; /* closed / destructive red */
/* ─── Typography ───────────────────────────────────────────────── */
/* System fonts only — no webfonts load in GitHub. */
--font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
--font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
--font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
/* Type scale — DESIGN.md §Typography.
* GitHub's prose density: 14px body (not 16px). Display sits at 32px.
* h2 (20px) and h3 (16px) collapse close together for density. */
--text-xs: 12px; /* body-small — captions, metadata */
--text-sm: 14px; /* body — default UI (GitHub's base) */
--text-base: 14px; /* body baseline = 14px for density */
--text-lg: 16px; /* h3 / panel header */
--text-xl: 20px; /* h2 — section heading */
--text-2xl: 24px; /* h1 — page heading */
--text-3xl: 28px; /* subpage display */
--text-4xl: 32px; /* display — repo header / hero */
/* Leading + tracking.
* GitHub uses 1.25 for headings (tight-but-readable), 1.5 for body.
* Only display gets the -0.01em tracking. */
--leading-body: 1.5;
--leading-tight: 1.25;
--tracking-display: -0.01em;
/* ─── Spacing ──────────────────────────────────────────────────── */
/* 4px base grid — Primer spacing. Row padding 16px h, 12px v. */
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-5: 20px;
--space-6: 24px;
--space-8: 32px;
--space-12: 48px;
/* Section rhythm — GitHub marketing pages. */
--section-y-desktop: 64px;
--section-y-tablet: 48px;
--section-y-phone: 32px;
/* ─── Radius ───────────────────────────────────────────────────── */
/* 6px is the universal Primer radius for all interactive elements. */
--radius-sm: 6px;
--radius-md: 6px;
--radius-lg: 12px;
--radius-pill: 9999px;
/* ─── Elevation ────────────────────────────────────────────────── */
/* GitHub uses hairline borders, not shadows, as the primary depth
signal. --elev-raised is a whisper for the rare floating element. */
--elev-flat: none;
--elev-ring: 0 0 0 1px var(--border);
--elev-raised: 0 1px 3px rgba(31, 35, 40, 0.12), 0 8px 24px rgba(66, 74, 83, 0.12);
/* ─── Focus ────────────────────────────────────────────────────── */
/* Primer focus: 3px rgba ring on the accent color. */
--focus-ring: 0 0 0 3px rgba(9, 105, 218, 0.3);
/* ─── Motion ───────────────────────────────────────────────────── */
/* GitHub avoids animation. 80ms hover, 200ms open — short and purposeful. */
--motion-fast: 80ms;
--motion-base: 200ms;
--ease-standard: ease-out;
/* ─── Layout ───────────────────────────────────────────────────── */
--container-max: 1280px;
--container-gutter-desktop: 24px;
--container-gutter-tablet: 16px;
--container-gutter-phone: 16px;
}