diff --git a/app/globals.css b/app/globals.css index 9b30d67..c21b406 100644 --- a/app/globals.css +++ b/app/globals.css @@ -1,37 +1,151 @@ @import "tailwindcss"; -:root { - --background: #ffffff; - --foreground: #171717; +/* Modernist tokens. Source of truth: the Modernist styles.css under design-system/_ds. + Static emits every variable so plain CSS can use var(--color-*) too. */ +@theme static { + --color-bg: #f3f2f2; + --color-surface: #eae9e9; + --color-text: #201e1d; + --color-accent: #ec3013; + --color-accent-2: #e15b47; + --color-divider: color-mix(in srgb, #201e1d 40%, transparent); + + /* Utility-friendly aliases: bg-ground, text-ink */ + --color-ground: var(--color-bg); + --color-ink: var(--color-text); + + --color-neutral-100: #f8f4f4; + --color-neutral-200: #eae7e7; + --color-neutral-300: #d7d3d3; + --color-neutral-400: #bab6b6; + --color-neutral-500: #9b9797; + --color-neutral-600: #7d7979; + --color-neutral-700: #605d5d; + --color-neutral-800: #444141; + --color-neutral-900: #2d2b2b; + + --color-accent-100: #fff2ef; + --color-accent-200: #ffe0d9; + --color-accent-300: #ffc4b8; + --color-accent-400: #ff9783; + --color-accent-500: #ff563c; + --color-accent-600: #dd2b0f; + --color-accent-700: #ae1800; + --color-accent-800: #7c1405; + --color-accent-900: #4d170e; + + --color-accent-2-100: #fff2ef; + --color-accent-2-200: #ffe0da; + --color-accent-2-300: #ffc4b9; + --color-accent-2-400: #ff9784; + --color-accent-2-500: #ef6853; + --color-accent-2-600: #c94b39; + --color-accent-2-700: #9e3526; + --color-accent-2-800: #71261b; + --color-accent-2-900: #471d16; + + /* Existing gray-* utilities render on the neutral ramp. */ + --color-gray-50: var(--color-neutral-100); + --color-gray-100: var(--color-neutral-200); + --color-gray-200: var(--color-neutral-300); + --color-gray-300: var(--color-neutral-400); + --color-gray-400: var(--color-neutral-500); + --color-gray-500: var(--color-neutral-600); + --color-gray-600: var(--color-neutral-700); + --color-gray-700: var(--color-neutral-800); + --color-gray-800: var(--color-neutral-900); + --color-gray-900: var(--color-text); + --color-gray-950: var(--color-text); + + /* Existing blue-* utilities render on the accent ramp. 600 is the canonical + accent; 700 and darker are safe for body-size text. */ + --color-blue-50: var(--color-accent-100); + --color-blue-100: var(--color-accent-100); + --color-blue-200: var(--color-accent-200); + --color-blue-300: var(--color-accent-300); + --color-blue-400: var(--color-accent-400); + --color-blue-500: var(--color-accent-500); + --color-blue-600: var(--color-accent); + --color-blue-700: var(--color-accent-700); + --color-blue-800: var(--color-accent-800); + --color-blue-900: var(--color-accent-900); + --color-blue-950: var(--color-accent-900); + + /* Zero corner radius, everywhere. */ + --radius: 0px; + --radius-xs: 0px; + --radius-sm: 0px; + --radius-md: 0px; + --radius-lg: 0px; + --radius-xl: 0px; + --radius-2xl: 0px; + --radius-3xl: 0px; + --radius-4xl: 0px; + + /* Elevation, tuned to the ground. */ + --shadow-sm: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent); + --shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent); + --shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent); + --shadow-xl: var(--shadow-lg); + --shadow-2xl: var(--shadow-lg); + + --font-sans: var(--font-archivo), system-ui, sans-serif; + --font-heading: var(--font-archivo), system-ui, sans-serif; } -@theme inline { - --color-background: var(--background); - --color-foreground: var(--foreground); - --font-sans: var(--font-geist-sans); - --font-mono: var(--font-geist-mono); -} +@layer base { + html { + background: var(--color-bg); + } -@media (prefers-color-scheme: dark) { - :root { - --background: #0a0a0a; - --foreground: #ededed; + body { + background: var(--color-bg); + color: var(--color-text); + font-family: var(--font-sans); + font-size: 15px; + line-height: 1.55; + } + + h1, h2, h3, h4, h5, h6 { + font-family: var(--font-heading); + font-weight: 800; + line-height: 1.12; + letter-spacing: -0.015em; + } + + :focus { + outline: none; + } + + :focus-visible { + outline: 2px solid var(--color-accent); + outline-offset: 2px; + } + + ::selection { + background: color-mix(in srgb, var(--color-accent) 30%, transparent); + } + + input, + textarea, + select { + color: var(--color-text); + } + + input::placeholder, + textarea::placeholder { + color: color-mix(in srgb, var(--color-text) 55%, transparent); + } + + button:disabled, + input:disabled, + select:disabled, + textarea:disabled { + opacity: 0.45; + cursor: not-allowed; } } -body { - background: var(--background); - color: var(--foreground); - font-family: Arial, Helvetica, sans-serif; -} - -input, -textarea, -select { - color: #111827; /* gray-900 — dark typed text */ -} - -input::placeholder, -textarea::placeholder { - color: #6b7280; /* gray-500 — readable placeholder */ +.grayscale { + filter: grayscale(1) contrast(1.08); } diff --git a/app/layout.tsx b/app/layout.tsx index a70b5f9..c7b9887 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,16 +1,11 @@ import type { Metadata } from 'next' -import { Geist, Geist_Mono } from 'next/font/google' +import { Archivo } from 'next/font/google' import './globals.css' import { I18nProvider } from '@/lib/i18n/context' import { getLocale, loadMessages } from '@/lib/i18n/server' -const geistSans = Geist({ - variable: '--font-geist-sans', - subsets: ['latin'], -}) - -const geistMono = Geist_Mono({ - variable: '--font-geist-mono', +const archivo = Archivo({ + variable: '--font-archivo', subsets: ['latin'], }) @@ -30,7 +25,7 @@ export default async function RootLayout({ return (
diff --git a/docs/superpowers/plans/2026-09-30-modernist-design-system-restyle.md b/docs/superpowers/plans/2026-09-30-modernist-design-system-restyle.md index 7fe58dd..05fb6fe 100644 --- a/docs/superpowers/plans/2026-09-30-modernist-design-system-restyle.md +++ b/docs/superpowers/plans/2026-09-30-modernist-design-system-restyle.md @@ -135,8 +135,8 @@ Replace the whole file with: ```css @import "tailwindcss"; -/* Modernist tokens. Source of truth: design-system/_ds/modernist-*/styles.css. - `static` emits every variable so plain CSS can use var(--color-*) too. */ +/* Modernist tokens. Source of truth: the Modernist styles.css under design-system/_ds. + Static emits every variable so plain CSS can use var(--color-*) too. */ @theme static { --color-bg: #f3f2f2; --color-surface: #eae9e9; @@ -207,6 +207,7 @@ Replace the whole file with: --color-blue-950: var(--color-accent-900); /* Zero corner radius, everywhere. */ + --radius: 0px; --radius-xs: 0px; --radius-sm: 0px; --radius-md: 0px; diff --git a/package-lock.json b/package-lock.json index 29ead5e..c23457c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "file-type": "^22.0.1", "idb": "^8.0.3", "jose": "^6.2.4", + "lucide-react": "^1.49.0", "next": "^16.3.7", "openai": "^6.46.0", "pdf-lib": "^1.17.1", @@ -3226,7 +3227,7 @@ "version": "19.2.17", "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.17.tgz", "integrity": "sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "csstype": "^3.2.2" @@ -4681,7 +4682,7 @@ "version": "3.2.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/d": { @@ -8169,6 +8170,21 @@ "es5-ext": "~0.10.2" } }, + "node_modules/lucide-react": { + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-1.49.0.tgz", + "integrity": "sha512-ApfaNM4/7jBrVopqLJ84Jz8TMQ1Q1JeZ1PmKh25aeS3E1FTVcMkSh1bEQB7dfzdIrwXRP8p3z4AJjTIHHb5IIA==", + "license": "ISC", + "peerDependencies": { + "@types/react": "*", + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/lz-string": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", diff --git a/package.json b/package.json index d9e2f5c..7b2605c 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "file-type": "^22.0.1", "idb": "^8.0.3", "jose": "^6.2.4", + "lucide-react": "^1.49.0", "next": "^16.3.7", "openai": "^6.46.0", "pdf-lib": "^1.17.1", diff --git a/tests/design/tokens.test.ts b/tests/design/tokens.test.ts new file mode 100644 index 0000000..c719d36 --- /dev/null +++ b/tests/design/tokens.test.ts @@ -0,0 +1,57 @@ +import { describe, it, expect } from 'vitest' +import { readFileSync } from 'fs' +import path from 'path' + +const css = readFileSync(path.resolve(__dirname, '../../app/globals.css'), 'utf8') + +describe('Modernist tokens in globals.css', () => { + it.each([ + ['--color-bg', '#f3f2f2'], + ['--color-surface', '#eae9e9'], + ['--color-text', '#201e1d'], + ['--color-accent', '#ec3013'], + ['--color-accent-700', '#ae1800'], + ['--color-neutral-900', '#2d2b2b'], + ])('declares %s as %s', (name, value) => { + expect(css).toMatch(new RegExp(`${name}:\\s*${value}`, 'i')) + }) + + it.each(['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl'])('zeroes --radius-%s', size => { + expect(css).toMatch(new RegExp(`--radius-${size}:\\s*0px`)) + }) + + it('zeroes the bare --radius used by the plain rounded class', () => { + expect(css).toMatch(/--radius:\s*0px/) + }) + + it('has no stray comment terminator before @theme', () => { + const head = css.slice(0, css.indexOf('@theme')) + expect(head.match(/\*\//g)?.length).toBe(head.match(/\/\*/g)?.length) + }) + + it('remaps the gray ramp onto the neutral ramp', () => { + expect(css).toMatch(/--color-gray-100:\s*var\(--color-neutral-200\)/) + expect(css).toMatch(/--color-gray-900:\s*var\(--color-text\)/) + }) + + it('remaps the blue ramp onto the accent ramp', () => { + expect(css).toMatch(/--color-blue-600:\s*var\(--color-accent\)/) + expect(css).toMatch(/--color-blue-700:\s*var\(--color-accent-700\)/) + }) + + it('maps shadows onto the Modernist elevation tokens', () => { + expect(css).toMatch(/--shadow-2xl:\s*var\(--shadow-lg\)/) + }) + + it('uses Archivo through the next/font variable', () => { + expect(css).toMatch(/--font-sans:\s*var\(--font-archivo\)/) + }) + + it('has no dark mode block', () => { + expect(css).not.toContain('prefers-color-scheme') + }) + + it('styles keyboard focus with the 2px accent ring', () => { + expect(css).toMatch(/:focus-visible\s*\{[^}]*outline:\s*2px solid var\(--color-accent\)/) + }) +})