Skip to content

feat: theme() design-tokens layer (Phase 1)#89

Merged
kiyeonjeon21 merged 3 commits into
mainfrom
feat/theme-tokens
Jun 22, 2026
Merged

feat: theme() design-tokens layer (Phase 1)#89
kiyeonjeon21 merged 3 commits into
mainfrom
feat/theme-tokens

Conversation

@kiyeonjeon21

Copy link
Copy Markdown
Owner

Phase 1 of the design layer. Turns the documented brand (DESIGN.md, Phase 0) into tokens in code.

What

  • packages/core/src/theme.ts (new, exported from @reframe/core / reframe-video):
    • brand — the reframe house style as data (the DESIGN.md values: accent #FF4D00, bg #0A0C14, the Inter type scale, Balanced motion tone, audio palette).
    • theme(overrides) — deep-merges a custom kit onto brand, so a consumer defines their brand once and reuses it (theme({ color: { accent: "#1E90FF" } })).
    • Theme / TypeStyle types (the foundation for a later IR-level, overlay-addressable theme).
  • Refactored examples/lib/deviceKit.ts (shared by every device scene) + 6 non-golden scenes to reference tokens instead of re-declaring inline BG/FG/MUTED/accent, canonicalizing drifted values (a random #FF5A1F orange becomes brand.color.accent, off-brand backgrounds become brand.color.bg).
  • Docs: brand/theme() usage in DESIGN.md and the eDSL guide. No plugin/skill change (no version bump).

Golden-safe by construction

brand is pure data and emits nothing into the IR, so referencing a token renders byte-identical to writing the literal. The 6 golden-tracked scenes are left untouched (their backgrounds drift from canonical, so tokenizing them would change snapshots). DisplayList goldens stay byte-identical.

Verification

  • pnpm test427 pass (421 + 6 new theme.test.ts); goldens byte-identical.
  • pnpm typecheck + pnpm lint clean.
  • Frame-render sanity on refactored scenes (data-explainer, cursor-fx) renders on-brand.

Not in this PR

Phase 2: an IR-level SceneIR.design field resolved in the compiler, overlay-addressable, with render --theme and per-brand batch. The Theme type here is its foundation.

🤖 Generated with Claude Code

kiyeonjeon21 and others added 3 commits June 22, 2026 22:14
Phase 1 of the design layer. `brand` is the reframe house style as code (the
DESIGN.md values: accent #FF4D00, bg #0A0C14, the Inter type scale, Balanced
motion tone, audio palette); `theme(overrides)` deep-merges a custom kit onto
it so a consumer defines their brand once and reuses it. Pure data: a theme
emits nothing into the IR, so referencing a token renders byte-identical to
writing the literal (goldens unchanged). The Theme type is the foundation for a
later IR-level, overlay-addressable theme. Exported from @reframe/core.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Source examples/lib/deviceKit.ts (shared by every device scene) and 6 non-golden
scenes from the brand tokens instead of re-declaring inline BG/FG/MUTED/accent.
Canonicalizes their drifted values to the house palette (e.g. a random #FF5A1F
orange becomes brand.color.accent #FF4D00, off-brand backgrounds become
brand.color.bg) for a consistent look. The golden-tracked scenes are left
untouched, so the determinism snapshots stay byte-identical.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Show importing `brand` and referencing tokens (`fill: brand.color.accent`,
`...brand.type.headline`) and building a custom kit with `theme({...})`. Note
that theme.ts is the source of truth the doc mirrors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kiyeonjeon21 kiyeonjeon21 merged commit 2b48124 into main Jun 22, 2026
1 check passed
@kiyeonjeon21 kiyeonjeon21 deleted the feat/theme-tokens branch June 22, 2026 13:18
@mintlify

mintlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
reframe 🔴 Failed Jun 22, 2026, 1:23 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant