Skip to content

feat(inspector): adopt @antfu/design design system (v0.2.0)#177

Open
antfubot wants to merge 2 commits into
antfu:mainfrom
antfubot:real-years-listen
Open

feat(inspector): adopt @antfu/design design system (v0.2.0)#177
antfubot wants to merge 2 commits into
antfu:mainfrom
antfubot:real-years-listen

Conversation

@antfubot

@antfubot antfubot commented Jun 28, 2026

Copy link
Copy Markdown

Adopts the @antfu/design design system (pinned to 0.2.0) in the inspector SPA, replacing the project's hand-rolled UnoCSS design layer with the package it was extracted from.

What changed

  • UnoCSS presetuno.config.ts composes presetAnthonyDesign for the theme ramps, semantic shortcuts (color-base, bg-*, border-*, btn-*, badge*, op-*), the color-scale-* severity layer and the bg-dots/bg-grid pattern rules. The project's WCAG-tuned green primary ramp is preserved verbatim. App-only shortcuts (icon-catppuccin, the bespoke z-index ladder, page-padding*, color-deprecated) stay local.
  • Styles — base / scrollbar / animation / floating-vue / reka-ui / splitpanes styling comes from @antfu/design/styles.css (the shipped styles recolor overlays via token --at-apply directives, so @unocss/transformer-directives is wired up). The app keeps ownership of its root surface and a few local overrides (xterm, reverse-spin keyframe, the PNG dot-grid, tooltip refinements).
  • Component — the migration-ratio donut renders with the package's DisplayDonut.

Notes

  • The app's PNG dot-grid backdrop is renamed bg-dot-grid so it no longer collides with the preset's bg-dots pattern rule.
  • The preset blocks plain z-<number> utilities in favour of named layers; this app already owns a deliberate z-index system (a named ladder plus a few local, within-component z values), so it opts out via blocklists: { plainZIndex: false }.
  • 0.2.0 fixed the color-ramp helper's strict typing and moved the overlay deps to optional peers, so no dependency patch is needed (the earlier 0.1.0 patch and vue-demi build allowance are gone). A small Preset cast remains in uno.config.ts because the package still resolves its own @unocss/core instance under the pinned-nightly lockfile.

Scope

This is the "foundation + clean components" slice. The other local components (version / empty-state / safe-image / number-badge / checkbox / percentage) encode app-specific behaviour — string version prefixes, npm:/workspace: specs, image pre-loading, labelled proportion segments — that the minimal package primitives don't cover 1:1, so they're left for a follow-up with visual QA.

Verification

typecheck, build, lint and unit tests pass. One pre-existing node-modules-tools h3 module-type test fails on main too (h3 v2-rc is ESM-only vs the stale dual expectation), unrelated to this change. Live browser / e2e a11y QA is recommended as a follow-up (Playwright chromium isn't preinstalled in this environment).

This PR was created with the help of an agent.

antfubot added 2 commits June 28, 2026 13:55
Replace the hand-rolled UnoCSS design layer with the extracted
@antfu/design package: theme tokens, semantic shortcuts, the severity
scale and background patterns now come from presetAnthonyDesign, the
shared base/scrollbar/animation/floating-vue/reka-ui/splitpanes styles
come from @antfu/design/styles.css, and the migration-ratio donut now
renders with the package's DisplayDonut.

The bespoke PNG dot-grid backdrop is renamed bg-dot-grid so it no longer
collides with the preset's bg-dots pattern rule. A small dependency patch
lets the package's color-ramp helper pass the project's strict
noUncheckedIndexedAccess typecheck.
0.2.0 fixes the color-ramp helper's strict typing and moves the overlay
deps (reka-ui/splitpanes/@TanStack) to optional peers, so the local
dependency patch and the vue-demi build allowance are both dropped, and
the duplicate overlay deps fall out of the lockfile.

Adapt to the new preset behaviour: opt out of the plain-`z-<number>`
blocklist (the app already owns a deliberate z-index system), drop the
now-redundant `content.pipeline.include` (the default scan already picks
up the package's components), and apply the root surface from the app's
own CSS so it never depends on the directives transformer reaching the
package's node_modules styles.
@antfubot antfubot changed the title feat(inspector): adopt @antfu/design design system feat(inspector): adopt @antfu/design design system (v0.2.0) Jun 28, 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