remarque-tokens 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/REMARQUE.md ADDED
@@ -0,0 +1,356 @@
1
+ # Remarque
2
+
3
+ **A typography-first design system for editorial, technical, and personal web projects.**
4
+
5
+ > In fine printing, a *remarque* is a small sketch drawn by the artist in the margin of a proof — a personal mark that distinguishes a limited edition from a mass run. This design system carries the same intent: every project built with Remarque should feel handmade, considered, and distinctly authored.
6
+
7
+ ---
8
+
9
+ ## Philosophy
10
+
11
+ Remarque exists because most developer sites and project pages look the same. They inherit the visual language of SaaS dashboards, startup landing pages, or component-library defaults. Remarque is the antidote: a system rooted in book typography, editorial design, and the quiet confidence of a well-made publication.
12
+
13
+ **Core beliefs:**
14
+
15
+ - Content is the hero. Components, motion, and color exist to support it.
16
+ - Typography is the primary visual system, not color, not illustration, not animation.
17
+ - Reading comfort always wins over ornamentation.
18
+ - Fewer components, used well, beat many components used carelessly.
19
+ - A personal site should feel *authored*, not assembled.
20
+
21
+ ---
22
+
23
+ ## Identity
24
+
25
+ Remarque projects should feel like a modern technical publication — not a generic app dashboard, not a startup landing page, not an admin panel.
26
+
27
+ **The system is:**
28
+ - Typography-forward and editorial
29
+ - Calm, precise, and spacious
30
+ - Readable and memorable
31
+ - Technical without being sterile
32
+
33
+ **The system is never:**
34
+ - Generic SaaS
35
+ - Decorative at the expense of reading
36
+ - Dense or dashboard-like
37
+ - Loud or attention-seeking
38
+
39
+ ---
40
+
41
+ ## Technology Stack
42
+
43
+ - **CSS framework:** Tailwind CSS — v4 via an `@theme` block written from tokens.css values (reference: `site/src/styles/globals.css`), or v3 via the shipped `tailwind.config.js`. One mechanism per project, never both.
44
+ - **Component primitives:** shadcn/ui (when reusable components are needed)
45
+ - **Markup:** Semantic HTML with ARIA landmarks
46
+ - **Theming:** Light and dark mode via `[data-theme]` attribute (system preference + manual toggle)
47
+ - **Accessibility:** USWDS-informed. Keyboard navigation, skip-to-content link, ARIA labels, WCAG AA contrast compliance, 44px touch targets, 14px minimum small text
48
+ - **Tokens:** Centralized CSS custom properties in two tiers — `tokens-core.css` (immutable identity) + `tokens-palette.css` (sanctioned personalization). `tokens.css` aggregates both. See "Token Tiers"
49
+ - **Fonts:** Self-hosted woff2 (no CDN dependency). Preloaded via `<link rel="preload">`
50
+ - **Package:** Copy `fonts.css` + `tokens.css` + `tokens-core.css` + `tokens-palette.css` + `fonts/` (plus `tailwind.config.js` for Tailwind v3 projects) — `tokens.css` aggregates the two tier files, so all three CSS files travel together. npm publication of `remarque-tokens` is tracked in #46/#48; until it ships, install from GitHub (`npm install github:williamzujkowski/remarque`) or use the copy path
51
+
52
+ ### Tailwind Spacing Integration Note
53
+
54
+ Never map Remarque's `--space-N` values onto Tailwind's default numeric spacing keys — in v4 `@theme` that means no `--spacing-9` through `--spacing-12`, and in a v3 config no `spacing: { "5"…"12" }` overrides. Remarque's scale is larger than Tailwind's (`--space-9` = 6rem vs Tailwind's 2.25rem), so colliding keys silently change utilities like `mt-12` from 3rem to 12rem. Both shipped artifacts namespace instead (`--spacing-remarque-N` in the reference `@theme`; `mt-remarque-N` utilities in `tailwind.config.js`). Tailwind's default numeric utilities keep their default values.
55
+
56
+ ---
57
+
58
+ ## Token Tiers
59
+
60
+ Tokens live in two files with different contracts:
61
+
62
+ | Tier | File | Contains | Override policy |
63
+ |------|------|----------|-----------------|
64
+ | **Core** | `tokens-core.css` | Type scale + 17px body floor, line heights, tracking, weights, spacing scale, `--content-standard`/`--content-wide`, radius ceiling, motion durations, prose/typography machinery | **Never overridden.** A site that changes these has forked Remarque — it is no longer a Remarque site, by definition |
65
+ | **Palette** | `tokens-palette.css` | Font slots (`--font-display/body/mono`), all `--color-*`, `--content-reading` (the measure, which moves with the body font) | **Override freely** in a site stylesheet loaded after the tokens. Every replacement palette must pass the audit in both themes: `npm run audit` in this repo, `npx remarque-audit --palette <file> --src <dir>` in a consumer project |
66
+
67
+ Package subpaths for consumers: `remarque-tokens` (aggregator), `remarque-tokens/core`, `remarque-tokens/palette`, `remarque-tokens/fonts.css`.
68
+
69
+ This makes compliance mechanical: a site that overrides only palette-tier tokens is *authored*; one that touches core-tier tokens has *forked*. `tokens.css` imports both tiers, so existing consumers are unaffected.
70
+
71
+ ---
72
+
73
+ ## Font Slots
74
+
75
+ Remarque uses a three-slot font system. Each slot has a strict role, and each slot accepts a small set of approved faces — swap the face, keep the role.
76
+
77
+ | Slot | Default | Approved substitutes | Usage |
78
+ |------|---------|----------------------|-------|
79
+ | **Display** (`--font-display`) | Newsreader | Fraunces (display sizes only, ≥2rem — its optical character does not survive smaller sizes) | Page titles, hero headings, article titles |
80
+ | **Body** (`--font-body`) | Inter | Source Serif 4, system-ui stack | Body text, UI labels, navigation, buttons |
81
+ | **Mono** (`--font-mono`) | JetBrains Mono | IBM Plex Mono | Metadata rows, code blocks, labels, technical accents, timestamps |
82
+
83
+ **Font rules:**
84
+ - The display face is used *only* for display text at or above the section heading size. Never for body copy.
85
+ - The body face is the workhorse. All body text, UI elements, and navigation use it.
86
+ - The mono face is reserved for metadata, code, technical labels, and small accents. It is never used for headings or body text.
87
+ - Faces outside the approved lists require a spec amendment, not a silent swap. A fourth "accent" slot (hand-written or decorative faces) is not part of core Remarque; sites that add one must restrict it to marginalia and never prose.
88
+
89
+ ### Measure Compensation
90
+
91
+ `--content-reading` is calibrated to the body font — 46rem gives ~70 characters per line at 17px **Inter**, but the same width in a text serif runs ~85 characters, well past comfortable. When you swap the body slot, change the measure with it (target 66–72 ch/line at `--text-body`):
92
+
93
+ | Body face | `--content-reading` | Rationale |
94
+ |-----------|--------------------:|-----------|
95
+ | Inter (default) | 46rem | ~70 ch/line at 17px |
96
+ | system-ui stack | 46rem | metrics close to Inter |
97
+ | Source Serif 4 | 40rem | ~71 ch/line — measured on williamzujkowski.github.io, the reference consumer |
98
+
99
+ This is why the measure is palette-tier: it is a property of the font choice, not of the system's identity. The *target character count* is the invariant.
100
+
101
+ ---
102
+
103
+ ## Visual Rules
104
+
105
+ ### Do
106
+
107
+ - Use spacious layouts with generous whitespace
108
+ - Use a slightly oversized type scale (body text at 17px minimum)
109
+ - Constrain reading widths for prose (max 46rem / ~740px)
110
+ - Use quiet, subtle borders over shadows
111
+ - Use strong vertical rhythm and consistent spacing
112
+ - Keep components visually quiet and subordinate to content
113
+ - Use mono text for metadata, timestamps, tags, and technical details
114
+
115
+ ### Do Not
116
+
117
+ - Use Material Design visual language
118
+ - Use loud or decorative gradients
119
+ - Spam cards as a layout pattern
120
+ - Use over-rounded corners ("friendly SaaS" aesthetic)
121
+ - Build dense dashboard-style layouts
122
+ - Use animation that draws attention to itself
123
+ - Allow full-width prose on large screens
124
+ - Use glassmorphism or frosted-glass effects
125
+ - Stack decorative UI for its own sake
126
+
127
+ ---
128
+
129
+ ## Content Density Rule
130
+
131
+ No page should show more than three distinct content sections above the fold. The first screen of any page contains only: title, metadata, and the opening of content. Hero sections with CTAs, feature grids, and social proof are not part of Remarque's vocabulary.
132
+
133
+ ---
134
+
135
+ ## Image Treatment
136
+
137
+ Remarque is typography-first, but projects include screenshots, architecture diagrams, and terminal captures. These follow strict rules:
138
+
139
+ - Images sit within the reading column width (max `--content-reading`), never wider
140
+ - Images receive a 1px border using `--color-border` — never drop shadows
141
+ - Captions use mono text (`--font-mono`) at `--text-meta` size
142
+ - Architecture diagrams and terminal captures may extend to `--content-standard` width
143
+ - No rounded corners on images beyond `--radius-sm`
144
+ - Images are never decorative — every image must serve the content
145
+
146
+ ---
147
+
148
+ ## Motion Rules
149
+
150
+ Motion in Remarque is nearly invisible. The only permitted motion:
151
+
152
+ - **Hover states** on interactive elements (links, buttons, nav items): `--motion-fast` (120ms)
153
+ - **Theme transitions** (light/dark switch): `--motion-normal` (180ms)
154
+ - **Focus ring appearance**: `--motion-fast` (120ms)
155
+
156
+ **Explicitly prohibited:**
157
+ - Scroll-triggered animations
158
+ - Entrance/reveal animations
159
+ - Staggered load sequences
160
+ - Parallax effects
161
+ - Any animation on non-interactive elements
162
+
163
+ **Reduced motion:** all motion must respect `prefers-reduced-motion` (WCAG 2.3.3). Because every sanctioned transition uses the two duration tokens, tokens.css zeroes `--motion-fast`/`--motion-normal` under `prefers-reduced-motion: reduce` — motion authored with the tokens is automatically safe. Never hardcode durations; any future opt-in animation must live inside a `(prefers-reduced-motion: no-preference)` query.
164
+
165
+ ---
166
+
167
+ ## USWDS Accessibility Compliance
168
+
169
+ Remarque adopts typography and accessibility standards from the US Web Design System (USWDS) and WCAG 2.1:
170
+
171
+ ### Font Size Floors
172
+
173
+ | Token | Value | USWDS Rationale |
174
+ |-------|-------|-----------------|
175
+ | `--text-body` | 17px (1.0625rem) | Exceeds USWDS 16px minimum. Non-negotiable floor. |
176
+ | `--text-meta` | 14px (0.875rem) | USWDS minimum for small text. Used sparingly for metadata, labels, captions. |
177
+ | `--text-micro` | 13px (0.8125rem) | USWDS floor for timestamps and fine print only. Never for body content. |
178
+
179
+ ### Contrast Ratios (WCAG 2.1 AA)
180
+
181
+ | Pairing | Requirement | Notes |
182
+ |---------|-------------|-------|
183
+ | Normal text on background | 4.5:1 minimum | All text below 24px regular / 18.5px bold. Applies on `--color-surface` too, not just `--color-bg` |
184
+ | Large text on background | 3:1 minimum | Display and title text (24px+) |
185
+ | Functional non-text elements | 3:1 minimum | WCAG 1.4.11 — use `--color-border-bold` (meets 3:1). `--color-border` is decorative-only by design and exempt; never the sole boundary of an interactive element |
186
+
187
+ ### Touch Targets
188
+
189
+ All interactive elements (links, buttons, inputs) must have a minimum touch target of **44x44px** (WCAG 2.5.5 AAA). This applies to nav links, theme toggles, footer links, chips, and any clickable element.
190
+
191
+ ### Line Height
192
+
193
+ | Context | Minimum | Remarque Value |
194
+ |---------|---------|----------------|
195
+ | Body text (running copy) | 1.5 | 1.75 |
196
+ | Meta/caption text | 1.35 | 1.5 |
197
+ | Display/heading text | 1.0 | 1.05-1.2 |
198
+
199
+ ### Changing the Accent Hue
200
+
201
+ The accent is the single sanctioned expressive color. To personalize it, keep the **lightness** values from the default palette (lightness carries the contrast; hue carries the personality) and change hue/chroma:
202
+
203
+ 1. Re-derive all accent-family tokens at the same lightness steps: `--color-accent` (0.50 light / 0.68 dark), `--color-accent-hover` (0.42 / 0.75), `--color-accent-subtle` (0.95 / 0.22), `--color-selection-bg` (0.92 / 0.30).
204
+ 2. Reduce chroma until every value is inside the sRGB gamut — the audit rejects out-of-gamut colors because browsers clip them, so the authored value is not what renders. Different hues tolerate very different chroma at the same lightness (blues carry 0.14 at L 0.50; yellows and cyans will not).
205
+ 3. Run `npm run audit` (or, in a consumer project, `npx remarque-audit --palette your-palette.css --src src`). Accent and accent-hover must reach 4.5:1 on `--color-bg` in both themes. The audit is the gate — not every hue passes at every lightness, and the checklist wins over the hue.
206
+
207
+ ### Enforcement Checklist
208
+
209
+ Every PR that ships Remarque pages MUST pass (`npm run audit` automates the color/size lines):
210
+
211
+ - [ ] Body copy ≥ 17px (`var(--text-body)`). No hardcoded smaller sizes.
212
+ - [ ] Small text ≥ 14px (`var(--text-meta)`). Micro text (`--text-micro` / 13px) only for timestamps.
213
+ - [ ] `--color-muted` contrast ≥ 4.5:1 against `--color-bg` **and** `--color-surface` in both themes.
214
+ - [ ] `--color-fg-muted` contrast ≥ 7:1 (AAA) for body-adjacent prose.
215
+ - [ ] All transitions use `--motion-fast`/`--motion-normal` tokens (reduced-motion support depends on it).
216
+ - [ ] Every interactive element is ≥ 44×44px (use min-height/padding, not font-size to reach the floor).
217
+ - [ ] `font-variant-numeric: tabular-nums lining-nums` on all metadata that mixes with dates/counts.
218
+ - [ ] No hardcoded hex/rgb colors — only `var(--color-*)` tokens.
219
+ - [ ] Body line-height ≥ 1.5 (Remarque target: 1.75).
220
+
221
+ Agents reviewing PRs should reject changes that violate any line above without explicit rationale.
222
+
223
+ ---
224
+
225
+ ## Decision Order
226
+
227
+ When multiple design options are possible, choose in this order:
228
+
229
+ 1. The more **readable** option
230
+ 2. The more **typographically disciplined** option
231
+ 3. The **quieter** visual treatment
232
+ 4. The more **reusable, tokenized** solution
233
+ 5. The version with **less visual noise**
234
+
235
+ This order is not a suggestion. It is the tiebreaker for every design decision.
236
+
237
+ ---
238
+
239
+ ## Page Archetypes
240
+
241
+ Every page built with Remarque must conform to one of these four archetypes. Agents and implementers should not invent new page structures.
242
+
243
+ ### Essay
244
+
245
+ Long-form writing. The core content type.
246
+
247
+ **Always includes:**
248
+ - Large serif title (Newsreader, `--text-display` or `--text-title`)
249
+ - Mono metadata row (date, reading time, tags)
250
+ - Narrow reading column (`--content-reading`)
251
+ - Strong prose styling with generous line height
252
+ - Low-noise footer navigation (previous/next)
253
+
254
+ **Optionally includes:**
255
+ - Side table of contents on desktop (outside reading column)
256
+
257
+ **Never includes:**
258
+ - Sidebar content within the reading column
259
+ - More than one accent color
260
+ - Inline images wider than the reading column
261
+ - Share buttons or social widgets in the content area
262
+
263
+ ### Project Dossier
264
+
265
+ A project page. Technical, structured, informative.
266
+
267
+ **Always includes:**
268
+ - Serif title + one-paragraph summary
269
+ - Mono metadata block (stack, status, dates, links)
270
+ - Architecture or stack section
271
+ - Decisions/notes section
272
+
273
+ **Optionally includes:**
274
+ - Changelog or updates section
275
+ - Related project links
276
+ - Screenshots (within image treatment rules)
277
+
278
+ **Never includes:**
279
+ - Marketing language or CTAs
280
+ - Feature comparison grids
281
+ - Testimonials
282
+
283
+ ### Notebook
284
+
285
+ Short-form notes, bookmarks, links, observations. The informal content type.
286
+
287
+ **Always includes:**
288
+ - Compact entries with mono timestamps
289
+ - Minimal chrome — content-forward
290
+ - Consistent entry structure (even if entries vary in length)
291
+
292
+ **Optionally includes:**
293
+ - Tags or categories (mono text, not pill badges)
294
+ - Source links
295
+
296
+ **Never includes:**
297
+ - Card-based layouts
298
+ - Masonry grids
299
+ - Thumbnail images
300
+
301
+ ### Landing
302
+
303
+ The homepage or entry point. Sets the tone.
304
+
305
+ **Always includes:**
306
+ - A single clear statement of identity (serif, large)
307
+ - Navigation to primary content types
308
+ - Generous whitespace — the landing page should breathe
309
+
310
+ **Optionally includes:**
311
+ - Recent entries or updates (3–5 max)
312
+ - A brief "about" line
313
+
314
+ **Never includes:**
315
+ - Hero images or banners
316
+ - Multiple CTAs
317
+ - Feature grids
318
+ - Testimonial carousels
319
+ - Newsletter signup forms above the fold
320
+
321
+ ---
322
+
323
+ ## Signature Moves
324
+
325
+ These are the repeatable visual tells that make a Remarque site recognizable:
326
+
327
+ - Serif hero/page titles (Newsreader at display scale)
328
+ - Mono metadata rows beneath titles
329
+ - Constrained body width with generous margins
330
+ - Subtle `1px` section dividers using `--color-border`
331
+ - Quiet, understated footer
332
+ - Minimal accent color (one hue, used sparingly)
333
+ - Generous top padding before the main heading (`--space-9` or `--space-10`)
334
+ - Code and file path motifs rendered in mono at meta size
335
+
336
+ ---
337
+
338
+ ## Acceptance Criteria
339
+
340
+ An implementation succeeds when:
341
+
342
+ - The site is comfortable to read for extended periods
343
+ - Typography is the most memorable part of the design
344
+ - The design feels cohesive across all pages
345
+ - Technical details feel native to the aesthetic, not bolted on
346
+ - The result is distinctive without being gimmicky
347
+ - The mobile version is roomy and readable — not a compressed desktop layout
348
+ - A reader could identify it as a Remarque site without being told
349
+
350
+ ---
351
+
352
+ ## What Remarque Is Named For
353
+
354
+ In fine art printmaking, a *remarque* is a small original drawing made by the artist in the margin of a print. Found only in limited proof editions, the remarque is the mark that says: this was made by a specific person, with intention, by hand.
355
+
356
+ This system carries that idea forward. Every site built with Remarque should feel like it was made by someone who cares about how words sit on a page.
Binary file
Binary file
Binary file
Binary file
package/fonts.css ADDED
@@ -0,0 +1,59 @@
1
+ /*
2
+ * Remarque — Self-Hosted Fonts
3
+ * ─────────────────────────────
4
+ * @font-face declarations for the three-font system (latin subsets).
5
+ * No CDN requests: fonts resolve relative to this file.
6
+ *
7
+ * Usage (import BEFORE tokens.css):
8
+ * @import 'fonts.css';
9
+ * @import 'tokens.css';
10
+ *
11
+ * Copy the fonts/ directory alongside this file (or into your static
12
+ * assets dir and adjust the URLs). For best performance, preload the
13
+ * three roman faces in <head>:
14
+ * <link rel="preload" href="/fonts/inter-latin.woff2" as="font" type="font/woff2" crossorigin>
15
+ * <link rel="preload" href="/fonts/newsreader-latin.woff2" as="font" type="font/woff2" crossorigin>
16
+ * <link rel="preload" href="/fonts/jetbrains-mono-latin.woff2" as="font" type="font/woff2" crossorigin>
17
+ * (Italic faces load on demand; preloading them is rarely worth it.)
18
+ */
19
+
20
+ @font-face {
21
+ font-family: "Inter";
22
+ font-style: normal;
23
+ font-weight: 300 600;
24
+ font-display: swap;
25
+ src: url("fonts/inter-latin.woff2") format("woff2");
26
+ }
27
+
28
+ /* True italic — without this, em/blockquote render faux (synthesized) italic */
29
+ @font-face {
30
+ font-family: "Inter";
31
+ font-style: italic;
32
+ font-weight: 300 600;
33
+ font-display: swap;
34
+ src: url("fonts/inter-italic-latin.woff2") format("woff2");
35
+ }
36
+
37
+ @font-face {
38
+ font-family: "Newsreader";
39
+ font-style: normal;
40
+ font-weight: 300 600;
41
+ font-display: swap;
42
+ src: url("fonts/newsreader-latin.woff2") format("woff2");
43
+ }
44
+
45
+ @font-face {
46
+ font-family: "Newsreader";
47
+ font-style: italic;
48
+ font-weight: 300 600;
49
+ font-display: swap;
50
+ src: url("fonts/newsreader-italic-latin.woff2") format("woff2");
51
+ }
52
+
53
+ @font-face {
54
+ font-family: "JetBrains Mono";
55
+ font-style: normal;
56
+ font-weight: 300 500;
57
+ font-display: swap;
58
+ src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
59
+ }
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "remarque-tokens",
3
+ "version": "0.2.0",
4
+ "engines": {
5
+ "node": ">=18"
6
+ },
7
+ "description": "Typography-first design tokens for editorial, technical, and personal web projects",
8
+ "keywords": [
9
+ "design-system",
10
+ "typography",
11
+ "css",
12
+ "tailwind",
13
+ "design-tokens",
14
+ "oklch"
15
+ ],
16
+ "author": "William Zujkowski",
17
+ "license": "MIT",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/williamzujkowski/remarque"
21
+ },
22
+ "homepage": "https://williamzujkowski.github.io/remarque/",
23
+ "main": "tokens.css",
24
+ "bin": {
25
+ "remarque-audit": "scripts/audit.mjs"
26
+ },
27
+ "scripts": {
28
+ "audit": "node scripts/audit.mjs"
29
+ },
30
+ "exports": {
31
+ ".": "./tokens.css",
32
+ "./tokens": "./tokens.css",
33
+ "./tokens.css": "./tokens.css",
34
+ "./core": "./tokens-core.css",
35
+ "./palette": "./tokens-palette.css",
36
+ "./tokens-core.css": "./tokens-core.css",
37
+ "./tokens-palette.css": "./tokens-palette.css",
38
+ "./fonts.css": "./fonts.css",
39
+ "./fonts/*": "./fonts/*",
40
+ "./tailwind": "./tailwind.config.js"
41
+ },
42
+ "files": [
43
+ "tokens.css",
44
+ "tokens-core.css",
45
+ "tokens-palette.css",
46
+ "fonts.css",
47
+ "fonts/",
48
+ "scripts/audit.mjs",
49
+ "tailwind.config.js",
50
+ "REMARQUE.md",
51
+ "AGENT_RULES.md",
52
+ "LICENSE",
53
+ "CHANGELOG.md"
54
+ ]
55
+ }