@brignano/design 0.7.0 → 0.8.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/DECISIONS.md +73 -0
- package/DESIGN.md +69 -5
- package/README.md +3 -0
- package/components.css +2134 -0
- package/package.json +9 -2
- package/scripts/colour.mjs +41 -0
- package/scripts/email-tokens.mjs +58 -0
- package/tailwind.css +7 -0
- package/templates/article.css +167 -0
- package/templates/changelog.css +53 -0
- package/templates/email.html +61 -0
- package/templates/email.txt +10 -0
- package/templates/legal.css +65 -0
- package/tokens.css +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brignano/design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Shared design system for brignano surfaces — colour, type, space, shape, motion.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -17,8 +17,12 @@
|
|
|
17
17
|
"files": [
|
|
18
18
|
"tokens.css",
|
|
19
19
|
"tokens.chart.css",
|
|
20
|
+
"components.css",
|
|
20
21
|
"product-page.css",
|
|
22
|
+
"templates/",
|
|
21
23
|
"scripts/fold.mjs",
|
|
24
|
+
"scripts/email-tokens.mjs",
|
|
25
|
+
"scripts/colour.mjs",
|
|
22
26
|
"tailwind.css",
|
|
23
27
|
"DESIGN.md",
|
|
24
28
|
"DECISIONS.md"
|
|
@@ -27,7 +31,10 @@
|
|
|
27
31
|
"./tokens.css": "./tokens.css",
|
|
28
32
|
"./tokens.chart.css": "./tokens.chart.css",
|
|
29
33
|
"./tailwind.css": "./tailwind.css",
|
|
30
|
-
"./
|
|
34
|
+
"./components.css": "./components.css",
|
|
35
|
+
"./product-page.css": "./product-page.css",
|
|
36
|
+
"./templates/*": "./templates/*",
|
|
37
|
+
"./scripts/email-tokens.mjs": "./scripts/email-tokens.mjs"
|
|
31
38
|
},
|
|
32
39
|
"sideEffects": [
|
|
33
40
|
"*.css"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// colour.mjs — the one colour resolver, shared by check.mjs and
|
|
2
|
+
// email-tokens.mjs so the two can't drift. No dependencies.
|
|
3
|
+
|
|
4
|
+
export function hex(h) {
|
|
5
|
+
h = h.slice(1);
|
|
6
|
+
if (h.length === 3) h = [...h].map((c) => c + c).join('');
|
|
7
|
+
return [0, 2, 4].map((i) => parseInt(h.slice(i, i + 2), 16));
|
|
8
|
+
}
|
|
9
|
+
export const toHex = (rgb) => '#' + rgb.map((c) => Math.round(c).toString(16).padStart(2, '0')).join('');
|
|
10
|
+
|
|
11
|
+
// Resolves a value to { rgb, alpha } against a map of one theme's tokens.
|
|
12
|
+
// Handles hex, var() and the one color-mix form the tokens use:
|
|
13
|
+
// color-mix(in srgb, X N%, transparent).
|
|
14
|
+
export function resolve(value, map, seen = new Set()) {
|
|
15
|
+
value = value.trim();
|
|
16
|
+
const ref = value.match(/^var\((--[\w-]+)\)$/);
|
|
17
|
+
if (ref) {
|
|
18
|
+
if (seen.has(ref[1]) || !map.has(ref[1])) throw new Error(`cannot resolve ${ref[1]}`);
|
|
19
|
+
return resolve(map.get(ref[1]), map, new Set([...seen, ref[1]]));
|
|
20
|
+
}
|
|
21
|
+
if (/^#[0-9a-f]{3,6}$/i.test(value)) return { rgb: hex(value), alpha: 1 };
|
|
22
|
+
const mix = value.match(/^color-mix\(in srgb,\s*(.+?)\s+([\d.]+)%,\s*transparent\)$/);
|
|
23
|
+
if (mix) {
|
|
24
|
+
const c = resolve(mix[1], map, seen);
|
|
25
|
+
return { rgb: c.rgb, alpha: c.alpha * (+mix[2] / 100) };
|
|
26
|
+
}
|
|
27
|
+
throw new Error(`unsupported colour value: ${value}`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Splits on top-level commas, so light-dark(color-mix(…, x), y) splits once.
|
|
31
|
+
export function split(s) {
|
|
32
|
+
const out = [];
|
|
33
|
+
let depth = 0, start = 0;
|
|
34
|
+
for (let i = 0; i < s.length; i++) {
|
|
35
|
+
if (s[i] === '(') depth++;
|
|
36
|
+
else if (s[i] === ')') depth--;
|
|
37
|
+
else if (s[i] === ',' && depth === 0) { out.push(s.slice(start, i).trim()); start = i + 1; }
|
|
38
|
+
}
|
|
39
|
+
out.push(s.slice(start).trim());
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// email-tokens.mjs — fills an email template's colours from tokens.css.
|
|
2
|
+
//
|
|
3
|
+
// node scripts/email-tokens.mjs [template] > email.html
|
|
4
|
+
//
|
|
5
|
+
// Email clients can't read CSS custom properties, so templates/email.html
|
|
6
|
+
// names each colour as a token in double braces, like {{--ink}}, and this
|
|
7
|
+
// script swaps each one for the token's light-theme value (email is light
|
|
8
|
+
// only: client dark modes rewrite colours unpredictably). Translucent tokens are flattened onto --card, the
|
|
9
|
+
// email's surface. Content placeholders ({{heading}}, {{button_url}}, …) are
|
|
10
|
+
// left for your app to fill. Exits non-zero, naming the token, if one can't be
|
|
11
|
+
// resolved, so a renamed token fails loudly instead of sending a blank colour.
|
|
12
|
+
//
|
|
13
|
+
// No dependencies; the colour maths is colour.mjs, shared with check.mjs,
|
|
14
|
+
// which also imports resolveLight and TOKEN from here.
|
|
15
|
+
|
|
16
|
+
import { readFileSync, realpathSync } from 'node:fs';
|
|
17
|
+
import { fileURLToPath } from 'node:url';
|
|
18
|
+
import { resolve, split, toHex } from './colour.mjs';
|
|
19
|
+
|
|
20
|
+
const here = (p) => new URL(`../${p}`, import.meta.url);
|
|
21
|
+
export const TOKEN = /\{\{(--[\w-]+)\}\}/g;
|
|
22
|
+
|
|
23
|
+
// The first declaration of each custom property in tokens.css (the :root block).
|
|
24
|
+
export function tokenMap(css = readFileSync(here('tokens.css'), 'utf8')) {
|
|
25
|
+
const map = new Map();
|
|
26
|
+
const body = css.replace(/\/\*[\s\S]*?\*\//g, '');
|
|
27
|
+
for (const m of body.matchAll(/(--[\w-]+)\s*:\s*([^;]+);/g)) if (!map.has(m[1])) map.set(m[1], m[2].trim());
|
|
28
|
+
return map;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Light-theme value of a token as #rrggbb, flattened onto --card when translucent.
|
|
32
|
+
export function resolveLight(name, map = tokenMap()) {
|
|
33
|
+
if (!map.has(name)) throw new Error(`${name} is not a token in tokens.css`);
|
|
34
|
+
const light = new Map([...map].map(([k, v]) => {
|
|
35
|
+
const ld = v.match(/^light-dark\((.*)\)$/s);
|
|
36
|
+
return [k, ld ? split(ld[1])[0] : v];
|
|
37
|
+
}));
|
|
38
|
+
const c = resolve(`var(${name})`, light);
|
|
39
|
+
if (c.alpha === 1) return toHex(c.rgb);
|
|
40
|
+
const card = resolve('var(--card)', light).rgb;
|
|
41
|
+
return toHex(c.rgb.map((v, i) => v * c.alpha + card[i] * (1 - c.alpha)));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function fill(html, map = tokenMap()) {
|
|
45
|
+
return html.replace(TOKEN, (_, name) => resolveLight(name, map));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// argv[1] keeps a symlinked path (pnpm, npm link, workspaces) while
|
|
49
|
+
// import.meta.url is the real file, so compare real paths.
|
|
50
|
+
if (process.argv[1] && realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
51
|
+
const file = process.argv[2] ?? fileURLToPath(here('templates/email.html'));
|
|
52
|
+
try {
|
|
53
|
+
process.stdout.write(fill(readFileSync(file, 'utf8')));
|
|
54
|
+
} catch (e) {
|
|
55
|
+
console.error(`email-tokens: ${e.message}`);
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
}
|
package/tailwind.css
CHANGED
|
@@ -61,6 +61,13 @@
|
|
|
61
61
|
--color-diff-removed-ink: var(--diff-removed-ink);
|
|
62
62
|
--color-diff-removed-surface: var(--diff-removed-surface);
|
|
63
63
|
|
|
64
|
+
--color-code-surface: var(--code-surface);
|
|
65
|
+
--color-code-ink: var(--code-ink);
|
|
66
|
+
--color-code-keyword: var(--code-keyword);
|
|
67
|
+
--color-code-string: var(--code-string);
|
|
68
|
+
--color-code-comment: var(--code-comment);
|
|
69
|
+
--color-code-highlight: var(--code-highlight);
|
|
70
|
+
|
|
64
71
|
--color-mark: var(--mark);
|
|
65
72
|
--color-mark-ink: var(--mark-ink);
|
|
66
73
|
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/* @brignano/design — article and docs page template (#72)
|
|
2
|
+
One template for blog posts and product docs. Needs tokens.css and
|
|
3
|
+
components.css (for .prose and .disclosure).
|
|
4
|
+
|
|
5
|
+
Article:
|
|
6
|
+
<main class="article">
|
|
7
|
+
<header class="article-header">
|
|
8
|
+
<h1>Title</h1>
|
|
9
|
+
<p class="article-meta"><time datetime="2026-11-07">7 Nov 2026</time><span>4 min read</span></p>
|
|
10
|
+
</header>
|
|
11
|
+
<div class="prose">…</div>
|
|
12
|
+
<nav class="article-pager" aria-label="More articles">
|
|
13
|
+
<a rel="prev" href="…"><span class="article-pager-label">Previous</span>Title</a>
|
|
14
|
+
<a rel="next" href="…"><span class="article-pager-label">Next</span>Title</a>
|
|
15
|
+
</nav>
|
|
16
|
+
</main>
|
|
17
|
+
|
|
18
|
+
Docs mode wraps it with a section nav and an "On this page" list. Both are
|
|
19
|
+
<details class="disclosure">, so on a phone they are native disclosures:
|
|
20
|
+
<div class="article-docs"><div class="article-docs-layout">
|
|
21
|
+
<details class="disclosure article-nav"><summary>Docs</summary>
|
|
22
|
+
<nav aria-label="Docs"><ul><li><a href="…" aria-current="page">…</a></li></ul></nav>
|
|
23
|
+
</details>
|
|
24
|
+
<details class="disclosure article-toc"><summary>On this page</summary>
|
|
25
|
+
<nav aria-label="On this page"><ol><li><a href="#…">…</a></li></ol></nav>
|
|
26
|
+
</details>
|
|
27
|
+
<main class="article">…</main>
|
|
28
|
+
</div></div>
|
|
29
|
+
|
|
30
|
+
.article-docs is the container and .article-docs-layout the grid inside it
|
|
31
|
+
(an element can't query its own size). Layout follows the width of
|
|
32
|
+
.article-docs. The nav
|
|
33
|
+
moves to a sticky left column at 48rem and the contents list to a sticky
|
|
34
|
+
right column at 60rem. In a column the disclosure is shown open with its
|
|
35
|
+
summary hidden, via ::details-content; browsers without it keep the
|
|
36
|
+
disclosure. */
|
|
37
|
+
@layer brignano.components {
|
|
38
|
+
.article { container: article / inline-size; width: 100%; max-width: var(--measure); margin-inline: auto; }
|
|
39
|
+
.article-header { margin-bottom: var(--s6); }
|
|
40
|
+
.article-header > h1 { margin: 0; font-size: var(--text-3xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
|
|
41
|
+
.article-meta {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-wrap: wrap;
|
|
44
|
+
gap: var(--s1) var(--s2);
|
|
45
|
+
margin: var(--s2) 0 0;
|
|
46
|
+
font-family: var(--mono);
|
|
47
|
+
font-size: var(--text-sm);
|
|
48
|
+
color: var(--slate);
|
|
49
|
+
}
|
|
50
|
+
.article-meta > * + *::before { content: '·'; content: '·' / ''; margin-right: var(--s2); }
|
|
51
|
+
.article > .prose :is(h2, h3) { scroll-margin-top: var(--s5); }
|
|
52
|
+
|
|
53
|
+
/* Previous / next. State comes from rel, so either link can be left out. */
|
|
54
|
+
.article-pager {
|
|
55
|
+
display: grid;
|
|
56
|
+
grid-template-columns: minmax(0, 1fr);
|
|
57
|
+
gap: var(--s3);
|
|
58
|
+
margin-top: var(--s7);
|
|
59
|
+
padding-top: var(--s5);
|
|
60
|
+
border-top: 1px solid var(--line);
|
|
61
|
+
}
|
|
62
|
+
.article-pager > a {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
gap: var(--s1);
|
|
66
|
+
padding: var(--s3) var(--s4);
|
|
67
|
+
color: var(--ink);
|
|
68
|
+
font-weight: 500;
|
|
69
|
+
text-decoration: none;
|
|
70
|
+
border: 1px solid var(--line);
|
|
71
|
+
border-radius: var(--radius);
|
|
72
|
+
transition: background-color var(--dur-fast) var(--ease);
|
|
73
|
+
}
|
|
74
|
+
.article-pager > a[rel~='next'] { text-align: right; grid-column: -2; }
|
|
75
|
+
.article-pager > a:hover { background: var(--surface-hover); }
|
|
76
|
+
.article-pager > a:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
|
|
77
|
+
.article-pager-label { font-size: var(--text-sm); font-weight: 400; color: var(--ink-soft); }
|
|
78
|
+
@container article (min-width: 36rem) {
|
|
79
|
+
.article-pager { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Docs mode */
|
|
83
|
+
.article-docs {
|
|
84
|
+
container: article-docs / inline-size;
|
|
85
|
+
width: 100%;
|
|
86
|
+
max-width: calc(var(--measure) + 28rem);
|
|
87
|
+
margin-inline: auto;
|
|
88
|
+
}
|
|
89
|
+
.article-docs-layout {
|
|
90
|
+
display: grid;
|
|
91
|
+
grid-template-columns: minmax(0, 1fr);
|
|
92
|
+
grid-template-areas: 'nav' 'toc' 'main';
|
|
93
|
+
gap: var(--s4);
|
|
94
|
+
}
|
|
95
|
+
.article-docs-layout > .article-nav { grid-area: nav; }
|
|
96
|
+
.article-docs-layout > .article-toc { grid-area: toc; }
|
|
97
|
+
.article-docs-layout > .article { grid-area: main; margin-top: var(--s4); }
|
|
98
|
+
.article-docs-layout > details { border: 1px solid var(--line); border-radius: var(--radius); }
|
|
99
|
+
|
|
100
|
+
.article-nav ul, .article-toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s1); }
|
|
101
|
+
.article-nav-heading {
|
|
102
|
+
margin: var(--s3) 0 var(--s1);
|
|
103
|
+
padding-inline: var(--s2);
|
|
104
|
+
font-size: var(--text-xs);
|
|
105
|
+
font-weight: 600;
|
|
106
|
+
letter-spacing: 0.04em;
|
|
107
|
+
text-transform: uppercase;
|
|
108
|
+
color: var(--slate);
|
|
109
|
+
}
|
|
110
|
+
.article-nav-heading:first-child { margin-top: 0; }
|
|
111
|
+
.article-nav a, .article-toc a {
|
|
112
|
+
display: block;
|
|
113
|
+
padding: 2px var(--s2);
|
|
114
|
+
color: var(--ink-soft);
|
|
115
|
+
font-size: var(--text-sm);
|
|
116
|
+
text-decoration: none;
|
|
117
|
+
border-radius: var(--radius-sm);
|
|
118
|
+
}
|
|
119
|
+
.article-nav a:hover, .article-toc a:hover { color: var(--ink); background: var(--surface-hover); }
|
|
120
|
+
.article-nav a:focus-visible, .article-toc a:focus-visible { outline: 2px solid var(--i-ink); outline-offset: -2px; }
|
|
121
|
+
.article-nav a[aria-current='page'] { color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--i-ink); }
|
|
122
|
+
.article-toc a[aria-current] { color: var(--ink); font-weight: 600; }
|
|
123
|
+
|
|
124
|
+
@container article-docs (min-width: 48rem) {
|
|
125
|
+
.article-docs-layout {
|
|
126
|
+
grid-template-columns: 13rem minmax(0, 1fr);
|
|
127
|
+
grid-template-areas: 'nav toc' 'nav main';
|
|
128
|
+
column-gap: var(--s7);
|
|
129
|
+
}
|
|
130
|
+
.article-docs-layout > .article { margin-top: 0; }
|
|
131
|
+
@supports selector(::details-content) {
|
|
132
|
+
.article-docs-layout > .article-nav { align-self: start; position: sticky; top: var(--s5); border: 0; }
|
|
133
|
+
.article-docs-layout > .article-nav > summary { display: none; }
|
|
134
|
+
.article-docs-layout > .article-nav::details-content { content-visibility: visible; }
|
|
135
|
+
.article-docs-layout > .article-nav > :not(summary) { padding: 0; }
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
@container article-docs (min-width: 60rem) {
|
|
139
|
+
.article-docs-layout {
|
|
140
|
+
grid-template-columns: 13rem minmax(0, 1fr) 12rem;
|
|
141
|
+
grid-template-areas: 'nav main toc';
|
|
142
|
+
}
|
|
143
|
+
@supports selector(::details-content) {
|
|
144
|
+
.article-docs-layout > .article-toc { align-self: start; position: sticky; top: var(--s5); border: 0; }
|
|
145
|
+
.article-docs-layout > .article-toc > summary { display: none; }
|
|
146
|
+
.article-docs-layout > .article-toc > nav::before {
|
|
147
|
+
content: attr(aria-label);
|
|
148
|
+
content: attr(aria-label) / '';
|
|
149
|
+
display: block;
|
|
150
|
+
padding: 0 var(--s2) var(--s2);
|
|
151
|
+
font-size: var(--text-sm);
|
|
152
|
+
font-weight: 600;
|
|
153
|
+
color: var(--ink);
|
|
154
|
+
}
|
|
155
|
+
.article-docs-layout > .article-toc::details-content { content-visibility: visible; }
|
|
156
|
+
.article-docs-layout > .article-toc > :not(summary) { padding: 0; }
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@media (pointer: coarse) {
|
|
161
|
+
.article-nav ul, .article-toc ol { gap: 0; }
|
|
162
|
+
.article-nav a, .article-toc a { display: flex; align-items: center; min-height: 44px; }
|
|
163
|
+
}
|
|
164
|
+
@media (prefers-reduced-motion: reduce) {
|
|
165
|
+
.article-pager > a { transition: none; }
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* @brignano/design — changelog page template (#73)
|
|
2
|
+
Releases newest first. Each release is a version and date in mono, an
|
|
3
|
+
anchor to itself, and the hand-written notes in .prose. Needs tokens.css
|
|
4
|
+
and components.css (for .prose).
|
|
5
|
+
|
|
6
|
+
<main class="changelog">
|
|
7
|
+
<header class="changelog-header"><h1>Changelog</h1><p>…</p></header>
|
|
8
|
+
<article class="release" id="v0.7.0" aria-labelledby="v0.7.0-title">
|
|
9
|
+
<header class="release-meta">
|
|
10
|
+
<h2 class="release-version" id="v0.7.0-title"><a href="#v0.7.0">v0.7.0</a></h2>
|
|
11
|
+
<time class="release-date" datetime="2026-11-02">2 Nov 2026</time>
|
|
12
|
+
</header>
|
|
13
|
+
<div class="prose">…notes, headings from h3…</div>
|
|
14
|
+
</article>
|
|
15
|
+
</main>
|
|
16
|
+
|
|
17
|
+
The version and date sit in a left column when the changelog itself is
|
|
18
|
+
wider than 44rem, and above the notes when it isn't (container query, so
|
|
19
|
+
it works in any column). */
|
|
20
|
+
@layer brignano.components {
|
|
21
|
+
.changelog {
|
|
22
|
+
container: changelog / inline-size;
|
|
23
|
+
width: 100%;
|
|
24
|
+
max-width: calc(var(--measure) + 12rem);
|
|
25
|
+
margin-inline: auto;
|
|
26
|
+
}
|
|
27
|
+
.changelog-header { margin-bottom: var(--s7); }
|
|
28
|
+
.changelog-header > h1 { margin: 0; font-size: var(--text-3xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
|
|
29
|
+
.changelog-header > p { margin: var(--s2) 0 0; color: var(--ink-soft); }
|
|
30
|
+
|
|
31
|
+
.release {
|
|
32
|
+
display: grid;
|
|
33
|
+
grid-template-columns: minmax(0, 1fr);
|
|
34
|
+
gap: var(--s3);
|
|
35
|
+
padding-block: var(--s6);
|
|
36
|
+
border-top: 1px solid var(--line);
|
|
37
|
+
scroll-margin-top: var(--s5);
|
|
38
|
+
}
|
|
39
|
+
.release-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); }
|
|
40
|
+
.release-version { margin: 0; font-family: var(--mono); font-size: var(--text-lg); font-weight: 600; }
|
|
41
|
+
.release-version > a { color: var(--ink); text-decoration: none; border-radius: var(--radius-sm); }
|
|
42
|
+
.release-version > a:hover { text-decoration: underline; text-underline-offset: 3px; }
|
|
43
|
+
.release-version > a:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
|
|
44
|
+
.release-date { font-family: var(--mono); font-size: var(--text-sm); color: var(--slate); }
|
|
45
|
+
|
|
46
|
+
@container changelog (min-width: 44rem) {
|
|
47
|
+
.release { grid-template-columns: 10rem minmax(0, 1fr); gap: var(--s6); }
|
|
48
|
+
.release-meta { flex-direction: column; align-self: start; position: sticky; top: var(--s5); }
|
|
49
|
+
}
|
|
50
|
+
@media (pointer: coarse) {
|
|
51
|
+
.release-version > a { display: inline-flex; align-items: center; min-height: 44px; }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<!-- @brignano/design — transactional email
|
|
3
|
+
For notifications and auto-replies. Light only.
|
|
4
|
+
Colours are token names in double braces: run scripts/email-tokens.mjs
|
|
5
|
+
once to fill them from tokens.css. Then, per send, fill the content:
|
|
6
|
+
subject, preheader, product, heading, button_label, footer: plain text,
|
|
7
|
+
HTML-escaped by your app.
|
|
8
|
+
button_url: an absolute https:// URL, attribute-escaped.
|
|
9
|
+
body: HTML your app builds from escaped text, one
|
|
10
|
+
<p style="margin:0 0 12px;"> per paragraph. Never pass a sender's
|
|
11
|
+
raw input through unescaped.
|
|
12
|
+
Send email.txt as the text part, with body_text as plain text. -->
|
|
13
|
+
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
|
14
|
+
<head>
|
|
15
|
+
<meta charset="utf-8">
|
|
16
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
17
|
+
<meta name="color-scheme" content="light only">
|
|
18
|
+
<meta name="supported-color-schemes" content="light">
|
|
19
|
+
<meta name="x-apple-disable-message-reformatting">
|
|
20
|
+
<title>{{subject}}</title>
|
|
21
|
+
<style>
|
|
22
|
+
:root { color-scheme: light only; supported-color-schemes: light; }
|
|
23
|
+
body { margin: 0; padding: 0; width: 100% !important; -webkit-text-size-adjust: 100%; }
|
|
24
|
+
a { color: {{--i-ink}}; }
|
|
25
|
+
@media (max-width: 620px) {
|
|
26
|
+
.email-card { padding: 24px 20px !important; }
|
|
27
|
+
.email-outer { padding: 16px 8px !important; }
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
30
|
+
</head>
|
|
31
|
+
<body style="margin:0;padding:0;background-color:{{--bg}};">
|
|
32
|
+
<div style="display:none;max-height:0;overflow:hidden;mso-hide:all;">{{preheader}}​͏​͏​͏​͏</div>
|
|
33
|
+
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="{{--bg}}" style="background-color:{{--bg}};">
|
|
34
|
+
<tr>
|
|
35
|
+
<td class="email-outer" align="center" style="padding:32px 16px;">
|
|
36
|
+
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="max-width:560px;">
|
|
37
|
+
<tr>
|
|
38
|
+
<td style="padding:0 4px 16px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;font-size:15px;font-weight:600;letter-spacing:-0.01em;color:{{--ink}};">{{product}}</td>
|
|
39
|
+
</tr>
|
|
40
|
+
<tr>
|
|
41
|
+
<td class="email-card" bgcolor="{{--card}}" style="background-color:{{--card}};border:1px solid {{--line}};border-radius:12px;padding:32px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;color:{{--ink}};">
|
|
42
|
+
<h1 style="margin:0 0 12px;font-size:22px;line-height:1.3;font-weight:600;letter-spacing:-0.015em;color:{{--ink}};">{{heading}}</h1>
|
|
43
|
+
<div style="font-size:16px;line-height:1.6;color:{{--ink-soft}};">{{body}}</div>
|
|
44
|
+
<table role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin:24px 0 0;">
|
|
45
|
+
<tr>
|
|
46
|
+
<td bgcolor="{{--i}}" style="background-color:{{--i}};border-radius:8px;">
|
|
47
|
+
<a href="{{button_url}}" style="display:inline-block;padding:12px 20px;font-size:15px;font-weight:600;line-height:20px;color:{{--on-i}};text-decoration:none;border-radius:8px;">{{button_label}}</a>
|
|
48
|
+
</td>
|
|
49
|
+
</tr>
|
|
50
|
+
</table>
|
|
51
|
+
</td>
|
|
52
|
+
</tr>
|
|
53
|
+
<tr>
|
|
54
|
+
<td style="padding:16px 4px 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;font-size:13px;line-height:1.5;color:{{--slate}};">{{footer}}</td>
|
|
55
|
+
</tr>
|
|
56
|
+
</table>
|
|
57
|
+
</td>
|
|
58
|
+
</tr>
|
|
59
|
+
</table>
|
|
60
|
+
</body>
|
|
61
|
+
</html>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* @brignano/design — legal page template (#70)
|
|
2
|
+
Privacy policy, terms and the like. Layout only: the wording belongs to
|
|
3
|
+
each product. Needs tokens.css and components.css (for .prose).
|
|
4
|
+
|
|
5
|
+
<main class="legal">
|
|
6
|
+
<header class="legal-header">
|
|
7
|
+
<h1>Privacy policy</h1>
|
|
8
|
+
<p class="legal-updated">Last updated <time datetime="2026-11-07">7 Nov 2026</time></p>
|
|
9
|
+
</header>
|
|
10
|
+
<div class="legal-body">
|
|
11
|
+
<nav class="legal-toc" aria-labelledby="toc-title">
|
|
12
|
+
<h2 class="legal-toc-title" id="toc-title">On this page</h2>
|
|
13
|
+
<ol><li><a href="#what-we-collect">What we collect</a></li>…</ol>
|
|
14
|
+
</nav>
|
|
15
|
+
<div class="prose"><h2 id="what-we-collect">What we collect</h2>…</div>
|
|
16
|
+
</div>
|
|
17
|
+
</main>
|
|
18
|
+
|
|
19
|
+
The contents list sits above the text until the page itself is 52rem wide,
|
|
20
|
+
then becomes a sticky left column (container query, so it follows the
|
|
21
|
+
column, not the screen). Leave the nav out on short pages. */
|
|
22
|
+
@layer brignano.components {
|
|
23
|
+
.legal {
|
|
24
|
+
container: legal / inline-size;
|
|
25
|
+
width: 100%;
|
|
26
|
+
max-width: calc(var(--measure) + 16rem);
|
|
27
|
+
margin-inline: auto;
|
|
28
|
+
}
|
|
29
|
+
.legal-header { margin-bottom: var(--s6); padding-bottom: var(--s5); border-bottom: 1px solid var(--line); }
|
|
30
|
+
.legal-header > h1 { margin: 0; font-size: var(--text-3xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
|
|
31
|
+
.legal-updated { margin: var(--s2) 0 0; font-family: var(--mono); font-size: var(--text-sm); color: var(--slate); }
|
|
32
|
+
|
|
33
|
+
.legal-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
|
|
34
|
+
.legal-body > .prose :is(h2, h3) { scroll-margin-top: var(--s5); }
|
|
35
|
+
|
|
36
|
+
.legal-toc {
|
|
37
|
+
padding: var(--s4) var(--s5);
|
|
38
|
+
background: var(--card);
|
|
39
|
+
border: 1px solid var(--line);
|
|
40
|
+
border-radius: var(--radius);
|
|
41
|
+
}
|
|
42
|
+
.legal-toc-title { margin: 0 0 var(--s2); font-size: var(--text-sm); font-weight: 600; color: var(--ink); }
|
|
43
|
+
.legal-toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s1); }
|
|
44
|
+
.legal-toc a { color: var(--ink-soft); font-size: var(--text-sm); text-decoration: none; border-radius: var(--radius-sm); }
|
|
45
|
+
.legal-toc a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
|
|
46
|
+
.legal-toc a[aria-current] { color: var(--ink); font-weight: 600; }
|
|
47
|
+
.legal-toc a:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
|
|
48
|
+
|
|
49
|
+
@container legal (min-width: 52rem) {
|
|
50
|
+
.legal-body { grid-template-columns: 13rem minmax(0, 1fr); gap: var(--s7); }
|
|
51
|
+
.legal-toc {
|
|
52
|
+
align-self: start;
|
|
53
|
+
position: sticky;
|
|
54
|
+
top: var(--s5);
|
|
55
|
+
padding: 0;
|
|
56
|
+
background: none;
|
|
57
|
+
border: 0;
|
|
58
|
+
border-radius: 0;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
@media (pointer: coarse) {
|
|
62
|
+
.legal-toc ol { gap: 0; }
|
|
63
|
+
.legal-toc a { display: flex; align-items: center; min-height: 44px; }
|
|
64
|
+
}
|
|
65
|
+
}
|
package/tokens.css
CHANGED
|
@@ -226,6 +226,23 @@
|
|
|
226
226
|
--diff-removed-ink: var(--danger-ink);
|
|
227
227
|
--diff-removed-surface: var(--danger-surface);
|
|
228
228
|
|
|
229
|
+
/* ── Code ─────────────────────────────────────────────────────────────
|
|
230
|
+
Syntax colour without a rainbow (DESIGN.md §3): keywords take the
|
|
231
|
+
interactive cobalt ink, everything else is a step of the neutral ramp,
|
|
232
|
+
and weight and italics do the rest. All aliases, so code adds no hue.
|
|
233
|
+
|
|
234
|
+
--code-surface the block, inset one step below the card
|
|
235
|
+
--code-keyword if, return, const — cobalt ink
|
|
236
|
+
--code-string literals — secondary ink
|
|
237
|
+
--code-comment comments — slate, set in italics
|
|
238
|
+
--code-highlight a highlighted line — the cobalt wash */
|
|
239
|
+
--code-surface: var(--bg);
|
|
240
|
+
--code-ink: var(--ink);
|
|
241
|
+
--code-keyword: var(--i-ink);
|
|
242
|
+
--code-string: var(--ink-soft);
|
|
243
|
+
--code-comment: var(--slate);
|
|
244
|
+
--code-highlight: var(--i-surface);
|
|
245
|
+
|
|
229
246
|
/* ── Mark — identity ──────────────────────────────────────────────────
|
|
230
247
|
Inks a GRAPHIC: the trail line, the A|B monogram, a hero rule. That is
|
|
231
248
|
the entire permitted use.
|