Skip to content

Add interactive state, z-index, and dark mode design tokens - #9

Merged
neithhogg merged 6 commits into
mainfrom
claude/open-spec-future-proposal-lofGw
Apr 4, 2026
Merged

Add interactive state, z-index, and dark mode design tokens#9
neithhogg merged 6 commits into
mainfrom
claude/open-spec-future-proposal-lofGw

Conversation

@neithhogg

Copy link
Copy Markdown
Owner

Summary

Expands the Mori design token system from 60 to 71 tokens across three new groups: interactive states (focus rings, disabled opacity, surface overlay), z-index layering, and dark mode colour overrides. All changes are additive to globals.css with no breaking changes to existing tokens.

Key Changes

  • Interactive State Tokens — Added --focus-ring-color, --focus-ring-width, --focus-ring-offset, --opacity-disabled, and --color-surface-overlay to :root for consistent focus indicators, disabled states, and modal backdrops across all components
  • Z-Index Scale — Added six named semantic layers (--z-base, --z-dropdown, --z-sticky, --z-overlay, --z-modal, --z-toast) with values 0, 100, 200, 300, 400, 500 to eliminate magic numbers in component layering
  • Dark Mode Theme Layer — Added [data-theme="dark"] selector block that overrides all 19 colour tokens plus focus-ring and surface-overlay tokens, using a warm near-black palette with adjusted brand green and semantic colours that meet WCAG AA contrast ratios
  • Component Updates — Updated Button, Input, Dialog, and DataTable to use new tokens via Tailwind arbitrary-value syntax (z-[var(--z-modal)], disabled:opacity-[var(--opacity-disabled)], etc.)
  • Test Coverage — Added Vitest assertions to verify all 71 tokens are present and that every colour token in :root has a matching dark-mode override
  • Specification — Created three new specs (token-interactive-states, token-z-index, token-dark-mode) and updated design-tokens spec to reflect the expanded token groups and count

Implementation Details

  • Dark mode is activated via data-theme="dark" attribute on <html>, not @media (prefers-color-scheme), allowing products to control theme switching independently
  • Focus ring colour anchored to --color-brand (森緑 green) in both light and dark modes to reinforce brand identity
  • Z-index values spaced by 100 to allow products to insert intermediate layers without forking the scale
  • All colour tokens in dark block use WCAG AA-compliant contrast ratios (≥4.5:1 for body text, ≥3:1 for UI components)
  • Non-colour token groups (typography, spacing, radius, shadows, motion) remain theme-agnostic and are not duplicated in dark block

https://claude.ai/code/session_012ywkmKYwcVd9EJ14mpuaFt

claude added 6 commits April 4, 2026 00:55
Adds a full OpenSpec change proposal for expanding the Mori design token
set with three new capability areas:
- Interactive state tokens (focus ring, disabled opacity, surface overlay)
- Z-index scale (6 named semantic layers)
- Dark mode theme layer ([data-theme="dark"] colour overrides)

Also includes a delta spec for the existing design-tokens capability
updating the group count from 6 to 9 and token total to 90.

https://claude.ai/code/session_012ywkmKYwcVd9EJ14mpuaFt
Adds three new token groups to globals.css (interactive states, z-index
scale, dark mode) and updates all components to consume them.

Token additions (71 :root tokens total, up from 60):
- Interactive states: --focus-ring-color/width/offset, --opacity-disabled,
  --color-surface-overlay
- Z-index scale: --z-base/dropdown/sticky/overlay/modal/toast (0–500)
- Dark mode: [data-theme="dark"] block with WCAG AA-compliant dark palette

Component updates:
- Button/Input: use focus-ring tokens and --opacity-disabled (was 0.50)
- Dialog: backdrop uses --color-surface-overlay; panel uses --z-modal;
  backdrop uses --z-overlay
- DataTable: z-10/20/30 replaced with --z-dropdown/sticky/overlay tokens

Spec promotion:
- openspec/specs/token-interactive-states/spec.md (new)
- openspec/specs/token-z-index/spec.md (new)
- openspec/specs/token-dark-mode/spec.md (new)
- openspec/specs/design-tokens/spec.md updated (6 groups → 9)

Tests: 240/240 passing; globals.test.ts updated and extended with
dark-mode parity assertion.

https://claude.ai/code/session_012ywkmKYwcVd9EJ14mpuaFt
Fixes the Format CI check which was failing on 63 files. The files
touched by the design-token-expansion implementation had minor formatting
drifts; the rest are pre-existing issues in PROJECT.md, showcase/, and
.claude/.github skill/prompt files brought into compliance in the same pass.

https://claude.ai/code/session_012ywkmKYwcVd9EJ14mpuaFt
…cess

Array index access returns T | undefined in strict mode. Added ! assertions
on items[0], cells[0], rows[0], and events[n] where the test logic
guarantees the elements exist.

https://claude.ai/code/session_012ywkmKYwcVd9EJ14mpuaFt
ESLint @typescript-eslint/no-non-null-assertion forbids ! assertions.
Replaced with:
- Named event constants (eventFax, eventExtract) instead of events[n]
- Destructuring + if-throw guards instead of array[0]! access

https://claude.ai/code/session_012ywkmKYwcVd9EJ14mpuaFt
@neithhogg
neithhogg merged commit 66530c6 into main Apr 4, 2026
4 checks passed
@neithhogg
neithhogg deleted the claude/open-spec-future-proposal-lofGw branch April 4, 2026 13:36
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.

2 participants