78 lines
2.3 KiB
Markdown
78 lines
2.3 KiB
Markdown
# Lovable — Design Tokens Playground
|
|
|
|
**GitHub repo:** `saravanakumardb/temp_lovable-design-tokens-playground`
|
|
|
|
## Push Instructions
|
|
|
|
- Push directly to `main` — do NOT open a PR
|
|
- Only modify files in this repo
|
|
|
|
## Rules
|
|
|
|
- No `console.log`
|
|
- No network calls — mock data / localStorage only
|
|
- No hardcoded colors — no hex, no rgb/rgba/hsl, no `bg-[#123456]` Tailwind classes
|
|
- Do NOT commit `.env*`, `.next/`, `node_modules/`, `.vercel/`
|
|
- pnpm only
|
|
- `pnpm run check` must pass (`tsc --noEmit` + `eslint`)
|
|
- `pnpm run build` must pass (`next build --webpack`)
|
|
|
|
## CSS Token Contract
|
|
|
|
Define in `src/app/globals.css` under `:root` (add `.dark` override):
|
|
|
|
- `--ux-bg` — page background
|
|
- `--ux-surface` — card/panel surface
|
|
- `--ux-surface-2` — elevated surface
|
|
- `--ux-border` — borders
|
|
- `--ux-text` — primary text
|
|
- `--ux-text-muted` — secondary text
|
|
- `--ux-accent` — primary accent
|
|
- `--ux-accent-foreground` — text on accent
|
|
- `--ux-danger` — destructive/error
|
|
- `--ux-warning` — warning
|
|
- `--ux-success` — success
|
|
- `--ux-ring` — focus ring
|
|
- `--ux-shadow` — shadows
|
|
|
|
Use only via Tailwind: `bg-[var(--ux-surface)]`, `text-[var(--ux-text)]`, `border-[var(--ux-border)]`
|
|
|
|
## Component Architecture
|
|
|
|
- Reusable components → `src/components/`
|
|
- Pages in `src/app/**` compose components only
|
|
- Components must NOT import from `src/app/**`
|
|
|
|
## Stack
|
|
|
|
- Next.js 16 App Router, React 19, TypeScript strict
|
|
- TailwindCSS v4, pnpm
|
|
|
|
## Goal
|
|
|
|
Build a **Design Tokens Playground** micro-app for visual QA and cross-pollination — previewing a token-driven design system and spotting inconsistencies. Extremely polished UI.
|
|
|
|
## Pages
|
|
|
|
- `/` overview: theme switcher + token summary
|
|
- `/colors` color ramp preview + contrast checker
|
|
- `/typography` type scale preview
|
|
- `/components` component gallery
|
|
- `/audit` hardcoded color detector helper
|
|
|
|
## Features
|
|
|
|
**Theme controls:** theme toggle, density toggle (comfortable/compact), radius slider (small/medium/large)
|
|
|
|
**Contrast checker:** select foreground/background token → show WCAG pass/fail (client-side)
|
|
|
|
**Component gallery:** buttons, inputs, cards, alerts, tabs, table
|
|
|
|
**Audit helper:** paste code → highlight hex/rgb() → suggest token replacement (heuristic)
|
|
|
|
## Verification
|
|
|
|
```
|
|
pnpm install && pnpm run check && pnpm run build
|
|
```
|