Skip to content

Commit 2565679

Browse files
committed
fix(design): remove web font
1 parent feff553 commit 2565679

4 files changed

Lines changed: 1 addition & 7 deletions

File tree

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The `pnpm test` script intentionally runs `build` first so `tsnapi` snapshots co
4545
All five built-in plugins — and every example under `examples/` — share one design system, [`@antfu/design`](https://github.com/antfu/design), so they look and feel like one product across frameworks (Git is React/Next, terminals is Svelte, code-server is Vue, inspect is Vue, a11y is Solid, the examples are Preact/Next/vanilla). It's a dev dependency consumed at build time: its UnoCSS preset and shipped styles drive every surface, and its Vue components are the canonical reference every framework matches. There is no shared internal design package — each app wires the preset itself and owns its own component ports.
4646

4747
- **Respect the skills.** This design system is built to the `antfu` and `antfu-design` skills (UnoCSS-first, class-based semantic tokens, dual light/dark, anti-slop) — load and follow them when building or changing any UI here. The surfaces deliberately echo the upstream devtools they descend from; reference their UI/UX when in doubt: [`antfu/node-modules-inspector`](https://github.com/antfu/node-modules-inspector), [`antfu/vite-plugin-inspect`](https://github.com/antfu/vite-plugin-inspect), [`eslint/config-inspector`](https://github.com/eslint/config-inspector), and [`vitejs/devtools``packages/rolldown`](https://github.com/vitejs/devtools/tree/main/packages/rolldown).
48-
- **One preset, wired per app.** Each consumer's `uno.config.ts` composes the same stack: `presetAnthonyDesign({ primary })` (from `@antfu/design/unocss`, tuned to devframe's sage green) + `presetWind4()` + `presetIcons()` (Phosphor) + `presetWebFonts()` (DM Sans / DM Mono) + `transformerDirectives()` + `transformerVariantGroup()`, plus the named `z-*` layers the nav/overlay surfaces reference (`z-nav`, `z-dropdown`, `z-tooltip`, `z-toast`, `z-modal-*`, `z-drawer-*`) — `presetAnthonyDesign` blocks plain `z-<number>` so every layer is named. Keep the block identical across apps so the surfaces stay consistent.
48+
- **One preset, wired per app.** Each consumer's `uno.config.ts` composes the same stack: `presetAnthonyDesign({ primary })` (from `@antfu/design/unocss`, tuned to devframe's sage green) + `presetWind4()` + `presetIcons()` (Phosphor) + `transformerDirectives()` + `transformerVariantGroup()`, plus the named `z-*` layers the nav/overlay surfaces reference (`z-nav`, `z-dropdown`, `z-tooltip`, `z-toast`, `z-modal-*`, `z-drawer-*`) — `presetAnthonyDesign` blocks plain `z-<number>` so every layer is named. Keep the block identical across apps so the surfaces stay consistent.
4949
- **Tokens are semantic shortcuts.** Build UI from `@antfu/design`'s class vocabulary — surfaces `bg-base` / `bg-secondary` / `bg-active`, text `color-base` / `color-muted` / `color-faint` / `color-active`, `border-base`, `op-fade` / `op-mute` — never a hardcoded palette. Import `@antfu/design/styles.css` (or cherry-pick `@antfu/design/styles/base.css` + `scrollbar.css`) once per page; dark mode is the `.dark` class on `<html>`, flipped from the OS preference in the SPA entry.
5050
- **Vue uses the components directly; other frameworks port them.** The Vue surface (inspect) imports components straight from `@antfu/design/components/*` (`ActionButton`, `ActionIconButton`, `DisplayBadge`, `LayoutTabs`, `LayoutToolbar`, `LayoutCard`, …). Every non-Vue surface ports the components it needs into its own framework — React in git and the Next examples, Svelte in terminals, Solid in a11y, Preact in the Preact examples, vanilla DOM helpers in the Vite hub — mirroring the upstream component's markup, classes and behavior so it renders identically. Port on demand: recreate only what a surface uses, and keep each port faithful to its `@antfu/design` source.
5151
- **One nav, three buttons, one tab selector — strictly.** Every surface opens with the same top bar — a `LayoutToolbar`-style row led by a brand block (a primary-tinted `i-ph:*` icon + the product name). Buttons come in exactly three forms: a **text button** (`ActionButton``btn-action` / `btn-primary`), a **bordered icon button** (`ActionIconButton``btn-icon-square`), and a **borderless icon button** (round `btn-icon`). Multi-view tools (inspect, git) switch views with the one shared segmented selector (`LayoutTabs` `variant="segment"`: a `bg-secondary` track with `data-[state=active]:bg-base` triggers). Don't invent bespoke nav bars, button shapes, or tab styles.

‎design/uno.config.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { presetAnthonyDesign } from '@antfu/design/unocss'
33
import {
44
defineConfig,
55
presetIcons,
6-
presetWebFonts,
76
presetWind4,
87
transformerDirectives,
98
transformerVariantGroup,
@@ -25,7 +24,6 @@ export const designConfig = defineConfig({
2524
presetAnthonyDesign({ primary: '#3a6a45' }),
2625
presetWind4(),
2726
presetIcons({ scale: 1.1 }),
28-
presetWebFonts({ provider: 'none', fonts: { sans: 'DM Sans', mono: 'DM Mono' } }),
2927
],
3028
transformers: [transformerDirectives(), transformerVariantGroup()],
3129
// The shared class-helper builders (`design/design.ts`) assemble their class

‎packages/json-render-ui/src/spa/uno.config.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { presetAnthonyDesign } from '@antfu/design/unocss'
22
import {
33
defineConfig,
44
presetIcons,
5-
presetWebFonts,
65
presetWind4,
76
transformerDirectives,
87
transformerVariantGroup,
@@ -17,7 +16,6 @@ export default defineConfig({
1716
presetAnthonyDesign({ primary: '#3a6a45' }),
1817
presetWind4(),
1918
presetIcons({ scale: 1.1 }),
20-
presetWebFonts({ provider: 'none', fonts: { sans: 'DM Sans', mono: 'DM Mono' } }),
2119
],
2220
transformers: [transformerDirectives(), transformerVariantGroup()],
2321
preflights: [{ getCSS: () => '*,::before,::after{border-color:#8882}' }],

‎packages/json-render-ui/uno.config.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { presetAnthonyDesign } from '@antfu/design/unocss'
22
import {
33
defineConfig,
44
presetIcons,
5-
presetWebFonts,
65
presetWind4,
76
transformerDirectives,
87
transformerVariantGroup,
@@ -18,7 +17,6 @@ export default defineConfig({
1817
presetAnthonyDesign({ primary: '#3a6a45' }),
1918
presetWind4(),
2019
presetIcons({ scale: 1.1 }),
21-
presetWebFonts({ provider: 'none', fonts: { sans: 'DM Sans', mono: 'DM Mono' } }),
2220
],
2321
transformers: [transformerDirectives(), transformerVariantGroup()],
2422
preflights: [{ getCSS: () => '*,::before,::after{border-color:#8882}' }],

0 commit comments

Comments
 (0)