feat(design): add Modernist tokens, theme remap and Archivo font
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
+134
-20
@@ -1,37 +1,151 @@
|
|||||||
@import "tailwindcss";
|
@import "tailwindcss";
|
||||||
|
|
||||||
:root {
|
/* Modernist tokens. Source of truth: the Modernist styles.css under design-system/_ds.
|
||||||
--background: #ffffff;
|
Static emits every variable so plain CSS can use var(--color-*) too. */
|
||||||
--foreground: #171717;
|
@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 {
|
@layer base {
|
||||||
--color-background: var(--background);
|
html {
|
||||||
--color-foreground: var(--foreground);
|
background: var(--color-bg);
|
||||||
--font-sans: var(--font-geist-sans);
|
|
||||||
--font-mono: var(--font-geist-mono);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
:root {
|
|
||||||
--background: #0a0a0a;
|
|
||||||
--foreground: #ededed;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background: var(--background);
|
background: var(--color-bg);
|
||||||
color: var(--foreground);
|
color: var(--color-text);
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
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,
|
input,
|
||||||
textarea,
|
textarea,
|
||||||
select {
|
select {
|
||||||
color: #111827; /* gray-900 — dark typed text */
|
color: var(--color-text);
|
||||||
}
|
}
|
||||||
|
|
||||||
input::placeholder,
|
input::placeholder,
|
||||||
textarea::placeholder {
|
textarea::placeholder {
|
||||||
color: #6b7280; /* gray-500 — readable 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.grayscale {
|
||||||
|
filter: grayscale(1) contrast(1.08);
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-9
@@ -1,16 +1,11 @@
|
|||||||
import type { Metadata } from 'next'
|
import type { Metadata } from 'next'
|
||||||
import { Geist, Geist_Mono } from 'next/font/google'
|
import { Archivo } from 'next/font/google'
|
||||||
import './globals.css'
|
import './globals.css'
|
||||||
import { I18nProvider } from '@/lib/i18n/context'
|
import { I18nProvider } from '@/lib/i18n/context'
|
||||||
import { getLocale, loadMessages } from '@/lib/i18n/server'
|
import { getLocale, loadMessages } from '@/lib/i18n/server'
|
||||||
|
|
||||||
const geistSans = Geist({
|
const archivo = Archivo({
|
||||||
variable: '--font-geist-sans',
|
variable: '--font-archivo',
|
||||||
subsets: ['latin'],
|
|
||||||
})
|
|
||||||
|
|
||||||
const geistMono = Geist_Mono({
|
|
||||||
variable: '--font-geist-mono',
|
|
||||||
subsets: ['latin'],
|
subsets: ['latin'],
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -30,7 +25,7 @@ export default async function RootLayout({
|
|||||||
return (
|
return (
|
||||||
<html
|
<html
|
||||||
lang={locale}
|
lang={locale}
|
||||||
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
|
className={`${archivo.variable} h-full antialiased`}
|
||||||
>
|
>
|
||||||
<head>
|
<head>
|
||||||
<link rel="manifest" href="/manifest.json" />
|
<link rel="manifest" href="/manifest.json" />
|
||||||
|
|||||||
@@ -135,8 +135,8 @@ Replace the whole file with:
|
|||||||
```css
|
```css
|
||||||
@import "tailwindcss";
|
@import "tailwindcss";
|
||||||
|
|
||||||
/* Modernist tokens. Source of truth: design-system/_ds/modernist-*/styles.css.
|
/* 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. */
|
Static emits every variable so plain CSS can use var(--color-*) too. */
|
||||||
@theme static {
|
@theme static {
|
||||||
--color-bg: #f3f2f2;
|
--color-bg: #f3f2f2;
|
||||||
--color-surface: #eae9e9;
|
--color-surface: #eae9e9;
|
||||||
@@ -207,6 +207,7 @@ Replace the whole file with:
|
|||||||
--color-blue-950: var(--color-accent-900);
|
--color-blue-950: var(--color-accent-900);
|
||||||
|
|
||||||
/* Zero corner radius, everywhere. */
|
/* Zero corner radius, everywhere. */
|
||||||
|
--radius: 0px;
|
||||||
--radius-xs: 0px;
|
--radius-xs: 0px;
|
||||||
--radius-sm: 0px;
|
--radius-sm: 0px;
|
||||||
--radius-md: 0px;
|
--radius-md: 0px;
|
||||||
|
|||||||
Generated
+18
-2
@@ -16,6 +16,7 @@
|
|||||||
"file-type": "^22.0.1",
|
"file-type": "^22.0.1",
|
||||||
"idb": "^8.0.3",
|
"idb": "^8.0.3",
|
||||||
"jose": "^6.2.4",
|
"jose": "^6.2.4",
|
||||||
|
"lucide-react": "^1.49.0",
|
||||||
"next": "^16.3.7",
|
"next": "^16.3.7",
|
||||||
"openai": "^6.46.0",
|
"openai": "^6.46.0",
|
||||||
"pdf-lib": "^1.17.1",
|
"pdf-lib": "^1.17.1",
|
||||||
@@ -3226,7 +3227,7 @@
|
|||||||
"version": "19.2.17",
|
"version": "19.2.17",
|
||||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.17.tgz",
|
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.17.tgz",
|
||||||
"integrity": "sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw==",
|
"integrity": "sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw==",
|
||||||
"dev": true,
|
"devOptional": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"csstype": "^3.2.2"
|
"csstype": "^3.2.2"
|
||||||
@@ -4681,7 +4682,7 @@
|
|||||||
"version": "3.2.3",
|
"version": "3.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
|
||||||
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
|
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
|
||||||
"dev": true,
|
"devOptional": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/d": {
|
"node_modules/d": {
|
||||||
@@ -8169,6 +8170,21 @@
|
|||||||
"es5-ext": "~0.10.2"
|
"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": {
|
"node_modules/lz-string": {
|
||||||
"version": "1.5.0",
|
"version": "1.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz",
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
"file-type": "^22.0.1",
|
"file-type": "^22.0.1",
|
||||||
"idb": "^8.0.3",
|
"idb": "^8.0.3",
|
||||||
"jose": "^6.2.4",
|
"jose": "^6.2.4",
|
||||||
|
"lucide-react": "^1.49.0",
|
||||||
"next": "^16.3.7",
|
"next": "^16.3.7",
|
||||||
"openai": "^6.46.0",
|
"openai": "^6.46.0",
|
||||||
"pdf-lib": "^1.17.1",
|
"pdf-lib": "^1.17.1",
|
||||||
|
|||||||
@@ -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\)/)
|
||||||
|
})
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user