zudo-text

検索したい単語を入力

いつでも検索バーを開ける

Wave 2 Token Audit — Design-Token-Lint Baseline (Issue #1273)

Wave 2 Token Audit — Design-Token-Lint Baseline (Issue #1273)

Caution

This document records the state of the design-token-lint violation baseline as of 2026-05-05. The violation list and per-file ignore counts are dated — they reflect a specific audit snapshot, not the current codebase. The per-file ignore mechanism described here has since been removed. This section is preserved as a historical record.

Additionally superseded by the Color Ramp Restructure epic (#3555): the "Default palette index" column below (p[3], p[11], etc.) describes the pre-restructure numeric-palette-index model. Tokens are now resolved via RampRefs ({ base | accent: n } or { state: role }) against the ramps.base / ramps.accent / ramps.state arrays — see @takazudo/color-themes for the current model.

Branch: open-issue-triage/token-audit Date: 2026-05-05 Violation total: 58 in 23 files (confirmed by running design-token-lint on the ignored baseline list)


Summary

This audit catalogs the 58 token-lint violations in the 23 ignored baseline files, maps each violation pattern to the semantic token Wave 2 sub-issues should use, and documents the new tokens added in this sub-issue.


New Tokens Added

Color tokens (packages/color-themes/src/color-settings.ts)

TokenDefault palette indexCSS varTailwind utility
warningp[3] (yellow, ANSI convention)--theme-warningtext-warning, bg-warning, border-warning
warningStrongp[11] (bright yellow, ANSI convention)--theme-warning-strongtext-warning-strong, bg-warning-strong, border-warning-strong
successp[2] (green, ANSI convention)--theme-successtext-success, bg-success, border-success
successStrongp[10] (bright green, ANSI convention)--theme-success-strongtext-success-strong, bg-success-strong, border-success-strong

The ANSI 16-color convention maps:

  • p[1]/p[9] = red/bright-red → already used as danger/dangerStrong

  • p[3]/p[11] = yellow/bright-yellow → warning/warningStrong

  • p[2]/p[10] = green/bright-green → success/successStrong

Note: warning and accent share the same default palette index (p[3]). This is intentional — both are "warm highlight" colors in standard ANSI palettes. Per-theme semantic overrides can assign distinct indices when themes need to differentiate. Wave 2 should use warning for caution/alert UI and accent for interactive/focus states.

CSS bridge (packages/ui-components/src/tokens.css)

Added Tailwind color token bridge entries:

--color-warning: var(--theme-warning);
--color-warning-strong: var(--theme-warning-strong);
--color-success: var(--theme-success);
--color-success-strong: var(--theme-success-strong);

Added CSS fallback values in the :root Tier 2 block:

--theme-warning: var(--palette-3);
--theme-warning-strong: var(--palette-11);
--theme-success: var(--palette-2);
--theme-success-strong: var(--palette-10);

No new spacing tokens needed

Every numeric spacing violation maps to an existing token. See the spacing mapping section below.


Violation Counts by Category

Color violations (30 total across 8 files)

Tailwind patternCountSemantic token to use
text-red-4005text-danger
text-red-3002text-danger
text-red-5001text-danger
text-red-100 (hover)1text-danger (lighter via opacity modifier or danger itself)
bg-red-500/102bg-danger/10
bg-red-500/151bg-danger/15
bg-red-900/401bg-danger/40 (or bg-danger-strong/40)
border-red-500/301border-danger/30
border-red-500/402border-danger/40
border-red-500/501border-danger/50
border-red-500/601border-danger/60
bg-yellow-6001bg-warning-strong
bg-amber-500/101bg-warning/10
bg-amber-500/151bg-warning/15
border-amber-500/402border-warning/40
text-amber-2001text-warning
text-amber-3001text-warning
bg-emerald-500/151bg-success/15
border-emerald-500/401border-success/40
text-emerald-3001text-success

Spacing violations (28 total across 19 files)

All map to existing tokens — no new tokens required.

Tailwind classTailwind valueExisting tokenCount
top-1/2, left-1/250%Use [50%] arbitrary value — not a spacing token semantic10
top-1, right-14pxxs4
right-4, bottom-416pxxl3
right-832px4xl1
p-28pxmd1
py-14pxxs2
py-312pxlg1
px-832px4xl1
mb-312pxlg1
mb-832px4xl2
mt-624px3xl1
mt-0.52px2xs3
ml-520px2xl2
gap-14pxxs1
space-y-14pxxs1

Note on top-1/2 / left-1/2: These appear in absolute-positioning centering patterns (e.g. top-1/2 -translate-y-1/2). The [50%] arbitrary value is the correct replacement — no semantic spacing token makes sense for a geometric "halfway" constant.


Files with Violations (Wave 2 targets)

packages/ (6 files — #1274)

FileColor violationsSpacing violations
packages/frontmatter-ui/src/list-fields.tsx01 (py-1)
packages/kanban-board/src/kanban-board.tsx01 (left-1/2)
packages/ui-components/src/chord-indicator.tsx01 (left-1/2)
packages/ui-components/src/panel-divider.tsx02 (top-1/2, left-1/2)
packages/ui-components/src/sidebar-search.tsx01 (top-1/2)
packages/ui-components/src/toast.tsx01 (left-1/2)

tauri-app/renderer/components/settings/ and mobile-tree (8 files — #1275)

FileColor violationsSpacing violations
settings/sections/ai-provider-settings.tsx4 (text-red-400, border-amber-500/40, bg-amber-500/10, text-amber-200)0
settings/sections/ai-suggestions-settings.tsx4 (border-red-500/40, bg-red-500/10, 2×text-red-400)0
settings/sections/ios-device-settings.tsx3 (text-red-500, border-red-500/30, hover:bg-red-500/10)0
settings/sections/ios-settings.tsx02 (ml-5, space-y-1)
settings/sections/raw-settings.tsx01 (ml-5)
settings/sections/shortcuts-settings.tsx01 (top-1/2)
settings/sections/sync-log-display.tsx1 (text-red-400)0
settings/mobile-tree/mobile-tree-select.tsx01 (top-1/2)

tauri-app/renderer remaining files (9 files — #1276)

FileColor violationsSpacing violations
archives/archives-header.tsx02 (2×top-1/2)
assets-manager-dialog.tsx07 (right-4×2, gap-1, p-2, left-1/2×2, bottom-4)
ios-offline-screen.tsx06 (mb-8×2, mb-3, px-8, py-3, mt-6)
pile-view-dialog.tsx5 (bg-red-900/40, border-red-500/50, 2×text-red-300, hover:text-red-100)1 (left-1/2)
quick-actions/quick-actions-builder.tsx3 (right-8, bg-yellow-600, 2×text-red-400) — also top-1/2 spacing2 (right-8 spacing, top-1/2)
search/sidebar.tsx01 (top-1/2)
split-terminal-view.tsx02 (top-1, right-1)
pages/ios-onboarding.tsx03 (3×mt-0.5)

Cases Where No New Token Is Needed (Existing Token Matches)

  • red- violations* → danger and danger-strong (already existed). Wave 2 uses text-danger, bg-danger/{opacity}, border-danger/{opacity}.

  • All numeric spacing violations → covered by existing spacing token scale (xs=4px, sm=6px, md=8px, lg=12px, xl=16px, 2xl=20px, 3xl=24px, 4xl=32px, 2xs=2px). No gaps found.

  • top-1/2, left-1/2 → Use [50%] Tailwind arbitrary value. These are geometric centering constants, not semantic spacing.


Rebuild Status

  • packages/color-themes: No build step. Exports directly from src/. No rebuild needed.

  • packages/ui-components: No build step. Exports directly from src/. No rebuild needed.