Skip to content

feat(design): unify built-in plugins on a shared @internal/design system#4

Closed
antfubot wants to merge 2 commits into
mainfrom
feat/unified-design-system
Closed

feat(design): unify built-in plugins on a shared @internal/design system#4
antfubot wants to merge 2 commits into
mainfrom
feat/unified-design-system

Conversation

@antfubot

Copy link
Copy Markdown
Owner

Why

The built-in plugins each shipped their own styling engine, palette, and components, so they read as three separate products:

Plugin Framework Engine Accent
git React / Next Tailwind v4 + shadcn violet
terminals Svelte UnoCSS green
code-server vanilla DOM hand-written CSS blue

This unifies them on one framework-neutral design system so the built-in plugins look and feel like a single product, with one source of truth for the look.

What

  • New @internal/design package (private, unpublished — consumed by the plugins only at build time):
    • presetDevframe() — the single UnoCSS preset every plugin extends. It bundles presetWind4 + presetIcons + the directive/variant-group transformers, the semantic token theme, and the shared df-* component vocabulary.
    • theme.css — the --df-* token values (light + dark via the .dark class); the only place colors are defined.
    • A prebuilt style.css for non-UnoCSS consumers.
  • Cross-framework consistency = a shared class contract. Markup differs per framework, but the same df-* classes (df-btn, df-badge, df-tab, df-navtab, df-card, df-input, df-dot, df-tag-*, …) and semantic token utilities (bg-primary, text-muted-foreground, bg-card, …) resolve identically everywhere.
  • Migrations: terminals and code-server now extend the shared preset and use the df-* vocabulary; git moves from Tailwind v4 + shadcn to UnoCSS (@unocss/postcss) driven by the same tokens.
  • Wires the package into alias.ts, tsconfig.base.json, the Turbo graph, and the pnpm frontend catalog, and documents the convention in AGENTS.md.

pnpm lint, pnpm typecheck, pnpm build, and pnpm test all pass; each plugin's built CSS was checked to confirm the shared tokens and classes are emitted.

This PR was created with the help of an agent.

antfubot added 2 commits June 24, 2026 06:53
The git (React/Next), terminals (Svelte) and code-server (vanilla DOM)
plugins each shipped their own styling engine, palette and components, so
they read as three different products. Introduce a single, framework-neutral
design system the built-in plugins extend, so they look and feel like one
product everywhere.

- Add @internal/design (private): one `presetDevframe()` UnoCSS preset
  (presetWind4 + presetIcons + directive/variant-group transformers + the
  semantic token theme + the shared `df-*` component vocabulary), the
  `--df-*` token values in theme.css (light/dark), and a prebuilt stylesheet
  for non-UnoCSS consumers.
- Migrate terminals and code-server onto the shared preset + `df-*` classes.
- Migrate git from Tailwind v4 + shadcn to UnoCSS driven by the same tokens.
- Wire the package into alias/tsconfig/turbo and document the convention.
Add a component layer on top of the token + class vocabulary so "a button",
"a tab", "a nav" have one definition shared across frameworks, not just a
documented class contract.

- @internal/design/components exports recipes — button, badge, tab, navTab,
  nav, toolbar, card, panel, input, link, dot, spinner, tag — that return the
  canonical `df-*` classes and read the same in React (className=), Svelte
  (class=) and vanilla DOM.
- Because the classes are assembled at runtime (so static extraction can't see
  them), the preset safelists the full `df-*` vocabulary. Add `df-nav` and
  `df-toolbar` bar shortcuts.
- Adopt the builders in all three plugins: git's shadcn Button/Badge/Card/Tabs
  shells, terminals' Svelte chrome, and code-server's vanilla launcher now
  describe the same components the same way.
@antfubot

Copy link
Copy Markdown
Owner Author

Superseded by devframes#45 (same branch, targeting upstream).

@antfubot antfubot closed this Jun 24, 2026
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