[Docs] Define design tokens (color, type, spacing, radius, motion) with light/dark themes

Open
#371 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
css, tailwindcss
Domain
design, frontend

Research direction

Start with docs/src/styles/tailwind.css and docs/src/styles/custom.css, then inspect TextNumber.astro and GroupName.astro for scattered styles. The issue proposes a token system, light and dark themes, locally loaded fonts, and a /design/tokens page; first map the existing styles and how the docs site loads them. Done means the listed acceptance criteria pass, including AA contrast in both themes.

Written by the indexing model from the issue text.

Description

area: docs-site priority: P2 size: M type: enhancement

Summary

Colours are scattered across tailwind.css (--primary, --muted...), custom.css (--sl-color-* overrides with hex values) and components (text-blue-400, #001f3f, #3fa9f5). Fonts Inter and JetBrains Mono are named but never loaded. There is no single token source to build a design system on.

Location

  • docs/src/styles/tailwind.css:3-60
  • docs/src/styles/custom.css:3-45
  • docs/src/components/TextNumber.astro:31-32
  • docs/src/components/GroupName.astro:8-14

Evidence

tailwind.css:37  --font-sans: 'Inter', ...      (no @font-face / font import anywhere)
ControlsTable.astro:114  font-family: 'JetBrains Mono', 'Fira Code', monospace;   (not loaded)
TextNumber.astro:31  .textnumber-list.dark {--bg: #001f3f; --border: #003366; color: #ddd; }
custom.css:17 --sl-color-text-accent: hsl(217.2, 91.2%, 59.8%)  -> 3.97:1 on code bg (axe)

Expected

One token file (CSS custom properties exposed through Tailwind 4 @theme) with semantic names, documented, contrast-checked in both themes.

Proposed fix

  1. src/styles/tokens.css: primitives (palette in OKLCH, type scale, space scale, radii, shadows, durations/easings) and semantic tokens (--color-bg, --color-fg, --color-muted, --color-accent, --color-code-bg, --color-border, math/theorem block colours, graph node colours per category).
  2. Themes via [data-theme=light|dark] + prefers-color-scheme default; prefers-reduced-motion tokens.
  3. Self-host fonts (woff2, font-display: swap) via Fontsource or astro:assets fonts.
  4. A /design/tokens page rendering swatches and a contrast table (all text/background pairs >= 4.5:1).

Acceptance criteria

  • No hard-coded colours remain in components (stylelint color-no-hex outside tokens.css)
  • Contrast table shows AA for every text token pair in both themes
  • Fonts load from the site origin

Repository audit, November 2026 · Phase 7 · Docs platform · evidence: reproduced · ref platform-022


Generated by Claude Code

Dominant language
C++
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ibra-kdbra/Math-Problems

All issues in ibra-kdbra/Math-Problems

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.