@brignano/design 0.7.0 → 0.9.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 +199 -0
- package/DESIGN.md +337 -13
- package/README.md +5 -1
- package/components.css +2248 -0
- package/icons/LICENSE +43 -0
- package/icons/arrow-down.svg +15 -0
- package/icons/arrow-left.svg +15 -0
- package/icons/arrow-right.svg +15 -0
- package/icons/arrow-up-down.svg +17 -0
- package/icons/arrow-up.svg +15 -0
- package/icons/bell.svg +15 -0
- package/icons/calendar.svg +17 -0
- package/icons/check.svg +14 -0
- package/icons/chevron-down.svg +14 -0
- package/icons/chevron-left.svg +14 -0
- package/icons/chevron-right.svg +14 -0
- package/icons/chevron-up.svg +14 -0
- package/icons/circle-check.svg +15 -0
- package/icons/circle-help.svg +16 -0
- package/icons/circle-x.svg +16 -0
- package/icons/clock.svg +15 -0
- package/icons/copy.svg +15 -0
- package/icons/download.svg +16 -0
- package/icons/ellipsis-vertical.svg +16 -0
- package/icons/ellipsis.svg +16 -0
- package/icons/external-link.svg +16 -0
- package/icons/eye-off.svg +17 -0
- package/icons/eye.svg +15 -0
- package/icons/funnel.svg +14 -0
- package/icons/house.svg +15 -0
- package/icons/info.svg +16 -0
- package/icons/link.svg +15 -0
- package/icons/lock.svg +15 -0
- package/icons/log-out.svg +16 -0
- package/icons/map-pin.svg +15 -0
- package/icons/menu.svg +16 -0
- package/icons/minus.svg +14 -0
- package/icons/monitor.svg +16 -0
- package/icons/moon.svg +14 -0
- package/icons/pencil.svg +15 -0
- package/icons/plus.svg +15 -0
- package/icons/refresh-cw.svg +17 -0
- package/icons/search.svg +15 -0
- package/icons/settings.svg +15 -0
- package/icons/sun.svg +22 -0
- package/icons/trash-2.svg +18 -0
- package/icons/triangle-alert.svg +16 -0
- package/icons/undo-2.svg +15 -0
- package/icons/upload.svg +16 -0
- package/icons/user.svg +15 -0
- package/icons/x.svg +15 -0
- package/package.json +11 -2
- package/product-page.css +31 -28
- package/scripts/colour.mjs +41 -0
- package/scripts/email-tokens.mjs +58 -0
- package/tailwind.css +28 -0
- package/templates/app-shell.css +346 -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/error.css +81 -0
- package/templates/legal.css +65 -0
- package/templates/settings.css +95 -0
- package/tokens.css +140 -14
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!-- @license lucide-static v1.60.0 - ISC -->
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="none"
|
|
8
|
+
stroke="currentColor"
|
|
9
|
+
stroke-width="2"
|
|
10
|
+
stroke-linecap="round"
|
|
11
|
+
stroke-linejoin="round"
|
|
12
|
+
>
|
|
13
|
+
<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" />
|
|
14
|
+
<path d="M21 3v5h-5" />
|
|
15
|
+
<path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" />
|
|
16
|
+
<path d="M8 16H3v5" />
|
|
17
|
+
</svg>
|
package/icons/search.svg
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- @license lucide-static v1.60.0 - ISC -->
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="none"
|
|
8
|
+
stroke="currentColor"
|
|
9
|
+
stroke-width="2"
|
|
10
|
+
stroke-linecap="round"
|
|
11
|
+
stroke-linejoin="round"
|
|
12
|
+
>
|
|
13
|
+
<path d="m21 21-4.34-4.34" />
|
|
14
|
+
<circle cx="11" cy="11" r="8" />
|
|
15
|
+
</svg>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- @license lucide-static v1.60.0 - ISC -->
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="none"
|
|
8
|
+
stroke="currentColor"
|
|
9
|
+
stroke-width="2"
|
|
10
|
+
stroke-linecap="round"
|
|
11
|
+
stroke-linejoin="round"
|
|
12
|
+
>
|
|
13
|
+
<path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" />
|
|
14
|
+
<circle cx="12" cy="12" r="3" />
|
|
15
|
+
</svg>
|
package/icons/sun.svg
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!-- @license lucide-static v1.60.0 - ISC -->
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="none"
|
|
8
|
+
stroke="currentColor"
|
|
9
|
+
stroke-width="2"
|
|
10
|
+
stroke-linecap="round"
|
|
11
|
+
stroke-linejoin="round"
|
|
12
|
+
>
|
|
13
|
+
<circle cx="12" cy="12" r="4" />
|
|
14
|
+
<path d="M12 2v2" />
|
|
15
|
+
<path d="M12 20v2" />
|
|
16
|
+
<path d="m4.93 4.93 1.41 1.41" />
|
|
17
|
+
<path d="m17.66 17.66 1.41 1.41" />
|
|
18
|
+
<path d="M2 12h2" />
|
|
19
|
+
<path d="M20 12h2" />
|
|
20
|
+
<path d="m6.34 17.66-1.41 1.41" />
|
|
21
|
+
<path d="m19.07 4.93-1.41 1.41" />
|
|
22
|
+
</svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!-- @license lucide-static v1.60.0 - ISC -->
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="none"
|
|
8
|
+
stroke="currentColor"
|
|
9
|
+
stroke-width="2"
|
|
10
|
+
stroke-linecap="round"
|
|
11
|
+
stroke-linejoin="round"
|
|
12
|
+
>
|
|
13
|
+
<path d="M10 11v6" />
|
|
14
|
+
<path d="M14 11v6" />
|
|
15
|
+
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" />
|
|
16
|
+
<path d="M3 6h18" />
|
|
17
|
+
<path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
|
|
18
|
+
</svg>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!-- @license lucide-static v1.60.0 - ISC -->
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="none"
|
|
8
|
+
stroke="currentColor"
|
|
9
|
+
stroke-width="2"
|
|
10
|
+
stroke-linecap="round"
|
|
11
|
+
stroke-linejoin="round"
|
|
12
|
+
>
|
|
13
|
+
<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" />
|
|
14
|
+
<path d="M12 9v4" />
|
|
15
|
+
<path d="M12 17h.01" />
|
|
16
|
+
</svg>
|
package/icons/undo-2.svg
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- @license lucide-static v1.60.0 - ISC -->
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="none"
|
|
8
|
+
stroke="currentColor"
|
|
9
|
+
stroke-width="2"
|
|
10
|
+
stroke-linecap="round"
|
|
11
|
+
stroke-linejoin="round"
|
|
12
|
+
>
|
|
13
|
+
<path d="M9 14 4 9l5-5" />
|
|
14
|
+
<path d="M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11" />
|
|
15
|
+
</svg>
|
package/icons/upload.svg
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!-- @license lucide-static v1.60.0 - ISC -->
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="none"
|
|
8
|
+
stroke="currentColor"
|
|
9
|
+
stroke-width="2"
|
|
10
|
+
stroke-linecap="round"
|
|
11
|
+
stroke-linejoin="round"
|
|
12
|
+
>
|
|
13
|
+
<path d="M12 3v12" />
|
|
14
|
+
<path d="m17 8-5-5-5 5" />
|
|
15
|
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
|
16
|
+
</svg>
|
package/icons/user.svg
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- @license lucide-static v1.60.0 - ISC -->
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="none"
|
|
8
|
+
stroke="currentColor"
|
|
9
|
+
stroke-width="2"
|
|
10
|
+
stroke-linecap="round"
|
|
11
|
+
stroke-linejoin="round"
|
|
12
|
+
>
|
|
13
|
+
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" />
|
|
14
|
+
<circle cx="12" cy="7" r="4" />
|
|
15
|
+
</svg>
|
package/icons/x.svg
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- @license lucide-static v1.60.0 - ISC -->
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="none"
|
|
8
|
+
stroke="currentColor"
|
|
9
|
+
stroke-width="2"
|
|
10
|
+
stroke-linecap="round"
|
|
11
|
+
stroke-linejoin="round"
|
|
12
|
+
>
|
|
13
|
+
<path d="M18 6 6 18" />
|
|
14
|
+
<path d="m6 6 12 12" />
|
|
15
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brignano/design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.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,13 @@
|
|
|
17
17
|
"files": [
|
|
18
18
|
"tokens.css",
|
|
19
19
|
"tokens.chart.css",
|
|
20
|
+
"components.css",
|
|
20
21
|
"product-page.css",
|
|
22
|
+
"templates/",
|
|
23
|
+
"icons/",
|
|
21
24
|
"scripts/fold.mjs",
|
|
25
|
+
"scripts/email-tokens.mjs",
|
|
26
|
+
"scripts/colour.mjs",
|
|
22
27
|
"tailwind.css",
|
|
23
28
|
"DESIGN.md",
|
|
24
29
|
"DECISIONS.md"
|
|
@@ -27,7 +32,11 @@
|
|
|
27
32
|
"./tokens.css": "./tokens.css",
|
|
28
33
|
"./tokens.chart.css": "./tokens.chart.css",
|
|
29
34
|
"./tailwind.css": "./tailwind.css",
|
|
30
|
-
"./
|
|
35
|
+
"./components.css": "./components.css",
|
|
36
|
+
"./product-page.css": "./product-page.css",
|
|
37
|
+
"./templates/*": "./templates/*",
|
|
38
|
+
"./icons/*": "./icons/*",
|
|
39
|
+
"./scripts/email-tokens.mjs": "./scripts/email-tokens.mjs"
|
|
31
40
|
},
|
|
32
41
|
"sideEffects": [
|
|
33
42
|
"*.css"
|
package/product-page.css
CHANGED
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
font-variant-numeric: tabular-nums;
|
|
67
67
|
-webkit-font-smoothing: antialiased;
|
|
68
68
|
}
|
|
69
|
-
.pp
|
|
70
|
-
|
|
71
|
-
.pp[data-mark
|
|
69
|
+
/* data-mark on .pp or on an ancestor (<html data-mark="teal">, the same
|
|
70
|
+
attribute the app uses) picks the mark; tokens.css resolves it. */
|
|
71
|
+
.pp[data-mark], [data-mark] .pp { --pp-mark: var(--mark-current); }
|
|
72
72
|
/* On <body>, drop the browser's 8px margin so the sticky header and every band
|
|
73
73
|
run to the screen edges. On a wrapper, the body is the site's business. */
|
|
74
74
|
body.pp { margin: 0; }
|
|
@@ -78,26 +78,26 @@ body.pp { margin: 0; }
|
|
|
78
78
|
.pp-wrap { max-width: var(--pp-width); margin: 0 auto; padding: 0 var(--pp-gutter); }
|
|
79
79
|
|
|
80
80
|
/* ── Skip link ─────────────────────────────────────────────────────────── */
|
|
81
|
-
.pp-skip { position: absolute; left: var(--s4); top: -100px; z-index:
|
|
81
|
+
.pp-skip { position: absolute; left: var(--s4); top: -100px; z-index: var(--z-float); padding: var(--s2) var(--s3);
|
|
82
82
|
background: var(--card); color: var(--ink); border-radius: var(--radius-sm); box-shadow: var(--shadow-2); }
|
|
83
83
|
.pp-skip:focus { top: var(--s3); }
|
|
84
84
|
|
|
85
85
|
/* ── Header ────────────────────────────────────────────────────────────── */
|
|
86
86
|
.pp-header {
|
|
87
|
-
position: sticky; top: 0; z-index:
|
|
87
|
+
position: sticky; top: 0; z-index: var(--z-sticky);
|
|
88
88
|
background: var(--surface-sticky); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
|
|
89
89
|
border-bottom: 1px solid var(--line);
|
|
90
90
|
}
|
|
91
91
|
.pp-header > .pp-wrap { display: flex; align-items: center; gap: var(--s5); min-height: 64px; }
|
|
92
92
|
.pp-brand {
|
|
93
93
|
display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none;
|
|
94
|
-
font-weight:
|
|
94
|
+
font-weight: var(--weight-semibold); font-size: var(--text-lg); letter-spacing: var(--tracking-title);
|
|
95
95
|
}
|
|
96
96
|
.pp-brand img, .pp-brand svg { width: 26px; height: 26px; }
|
|
97
97
|
/* An inline glyph drawn in currentColor takes the product's mark. */
|
|
98
98
|
.pp-brand svg { color: var(--pp-mark); }
|
|
99
99
|
.pp-nav { display: flex; align-items: center; gap: var(--s5); margin-left: auto; }
|
|
100
|
-
.pp-nav a { color: var(--ink-soft); text-decoration: none; font-size: var(--text-sm); font-weight:
|
|
100
|
+
.pp-nav a { color: var(--ink-soft); text-decoration: none; font-size: var(--text-sm); font-weight: var(--weight-medium); }
|
|
101
101
|
.pp-nav a:hover { color: var(--ink); }
|
|
102
102
|
.pp-header-actions { display: flex; align-items: center; gap: var(--s3); }
|
|
103
103
|
.pp-nav + .pp-header-actions { margin-left: 0; }
|
|
@@ -115,7 +115,7 @@ body.pp { margin: 0; }
|
|
|
115
115
|
neutral. The word always carries the meaning on its own. */
|
|
116
116
|
.pp-status {
|
|
117
117
|
display: inline-flex; align-items: center; gap: var(--s2); white-space: nowrap;
|
|
118
|
-
font: 500 var(--text-xs) / 1 var(--mono); letter-spacing:
|
|
118
|
+
font: 500 var(--text-xs) / 1 var(--mono); letter-spacing: var(--tracking-caps); text-transform: uppercase;
|
|
119
119
|
color: var(--ink-soft); padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 999px;
|
|
120
120
|
}
|
|
121
121
|
.pp-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--slate); flex: none; }
|
|
@@ -134,7 +134,7 @@ body.pp { margin: 0; }
|
|
|
134
134
|
}
|
|
135
135
|
.pp-button:hover { background: var(--i-hover); border-color: var(--i-hover); color: var(--on-i); }
|
|
136
136
|
.pp-button:active { background: var(--i-pressed); border-color: var(--i-pressed); }
|
|
137
|
-
.pp-button.is-secondary { background: transparent; color: var(--ink); border-color: var(--line-control); font-weight:
|
|
137
|
+
.pp-button.is-secondary { background: transparent; color: var(--ink); border-color: var(--line-control); font-weight: var(--weight-medium); }
|
|
138
138
|
.pp-button.is-secondary:hover { background: var(--surface-hover); color: var(--ink); }
|
|
139
139
|
.pp-button.is-secondary:active { background: var(--surface-active); }
|
|
140
140
|
.pp-button.is-small { font-size: var(--text-sm); padding: 8px 14px; }
|
|
@@ -183,11 +183,11 @@ body.pp { margin: 0; }
|
|
|
183
183
|
/* Who it's for, in a few words, above the thesis: "For teams running on AWS".
|
|
184
184
|
A stranger decides "is this for me?" before reading anything else. Ink,
|
|
185
185
|
not cobalt: cobalt says "you can act on this", and this is a label. */
|
|
186
|
-
.pp-audience { margin: 0 0 var(--s2); font-size: var(--text-base); font-weight:
|
|
186
|
+
.pp-audience { margin: 0 0 var(--s2); font-size: var(--text-base); font-weight: var(--weight-semibold); line-height: var(--leading-ui); color: var(--ink-soft); }
|
|
187
187
|
/* The thesis names the outcome in 8 words or fewer. On a phone it steps down
|
|
188
188
|
from --text-4xl so it takes two or three lines, not five. */
|
|
189
189
|
.pp-thesis {
|
|
190
|
-
font-size: min(var(--text-4xl), 1.25rem + 4vw); font-weight:
|
|
190
|
+
font-size: min(var(--text-4xl), 1.25rem + 4vw); font-weight: var(--weight-semibold); line-height: 1.04; letter-spacing: -0.035em;
|
|
191
191
|
margin: 0 0 var(--s4); max-width: 16ch; text-wrap: balance;
|
|
192
192
|
}
|
|
193
193
|
.pp-hero-head .pp-thesis { margin-bottom: 0; }
|
|
@@ -294,7 +294,7 @@ body.pp { margin: 0; }
|
|
|
294
294
|
}
|
|
295
295
|
.pp-steps > li {
|
|
296
296
|
counter-increment: pp-step; padding-top: var(--s2); border-top: 2px solid var(--line-strong);
|
|
297
|
-
font: 500 var(--text-xs) / 1.4 var(--mono); letter-spacing:
|
|
297
|
+
font: 500 var(--text-xs) / 1.4 var(--mono); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--ink-soft);
|
|
298
298
|
transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
|
|
299
299
|
}
|
|
300
300
|
.pp-steps > li::before { content: counter(pp-step) " "; color: var(--ink); }
|
|
@@ -306,7 +306,7 @@ body.pp { margin: 0; }
|
|
|
306
306
|
needs a way to stop it (WCAG 2.2.2). Hidden until the script wires it. */
|
|
307
307
|
.pp-play {
|
|
308
308
|
display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; cursor: pointer;
|
|
309
|
-
font: 500 var(--text-xs) / 1 var(--mono); letter-spacing:
|
|
309
|
+
font: 500 var(--text-xs) / 1 var(--mono); letter-spacing: var(--tracking-caps); text-transform: uppercase;
|
|
310
310
|
padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-control);
|
|
311
311
|
background: transparent; color: var(--ink);
|
|
312
312
|
}
|
|
@@ -321,8 +321,8 @@ body.pp { margin: 0; }
|
|
|
321
321
|
.pp-band { padding: var(--s8) 0; border-top: 1px solid var(--line); scroll-margin-top: 64px; }
|
|
322
322
|
@media (max-width: 560px) { .pp-band { padding: var(--s7) 0; } }
|
|
323
323
|
.pp-title {
|
|
324
|
-
font-size: clamp(var(--text-xl), 1rem + 2vw, var(--text-3xl)); font-weight:
|
|
325
|
-
letter-spacing: -
|
|
324
|
+
font-size: clamp(var(--text-xl), 1rem + 2vw, var(--text-3xl)); font-weight: var(--weight-semibold); line-height: var(--leading-display);
|
|
325
|
+
letter-spacing: var(--tracking-display); margin: 0; max-width: 24ch; text-wrap: balance;
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
/* What you get: three cards. Each is a small picture of the product doing the
|
|
@@ -335,7 +335,7 @@ body.pp { margin: 0; }
|
|
|
335
335
|
.pp-get-media { margin: 0; aspect-ratio: 16 / 9; overflow: hidden; display: grid; place-items: center;
|
|
336
336
|
background: var(--bg); border-bottom: 1px solid var(--line); }
|
|
337
337
|
.pp-get-media > img, .pp-get-media > video { display: block; width: 100%; height: 100%; object-fit: cover; }
|
|
338
|
-
.pp-get h3 { margin: var(--s4) var(--s4) 4px; font-size: var(--text-lg); font-weight:
|
|
338
|
+
.pp-get h3 { margin: var(--s4) var(--s4) 4px; font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: var(--leading-title); letter-spacing: var(--tracking-title); }
|
|
339
339
|
.pp-get p { margin: 0 var(--s4) var(--s4); color: var(--ink-soft); }
|
|
340
340
|
|
|
341
341
|
/* Compare: this product beside the thing the reader would otherwise use
|
|
@@ -347,7 +347,7 @@ body.pp { margin: 0; }
|
|
|
347
347
|
.pp-compare > div { padding: var(--s5); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); }
|
|
348
348
|
.pp-compare > .is-ours { border-top: 4px solid var(--pp-mark); box-shadow: var(--shadow-2); }
|
|
349
349
|
@media (max-width: 719px) { .pp-compare > .is-ours { order: -1; } }
|
|
350
|
-
.pp-compare h3 { margin: 0 0 var(--s3); font-size: var(--text-lg); font-weight:
|
|
350
|
+
.pp-compare h3 { margin: 0 0 var(--s3); font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: var(--leading-title); letter-spacing: var(--tracking-title); }
|
|
351
351
|
.pp-compare > :not(.is-ours) h3 { color: var(--ink-soft); }
|
|
352
352
|
.pp-compare ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
|
|
353
353
|
.pp-compare li { padding-top: var(--s2); border-top: 1px solid var(--line); }
|
|
@@ -361,7 +361,7 @@ body.pp { margin: 0; }
|
|
|
361
361
|
content: counter(pp-how); grid-row: span 2; display: inline-grid; place-items: center; width: 28px; height: 28px;
|
|
362
362
|
border-radius: 50%; border: 2px solid var(--pp-mark); font: 600 var(--text-sm) / 1 var(--mono); color: var(--ink);
|
|
363
363
|
}
|
|
364
|
-
.pp-how h3 { margin: 0; font-size: var(--text-lg); font-weight:
|
|
364
|
+
.pp-how h3 { margin: 0; font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: var(--leading-title); letter-spacing: var(--tracking-title); }
|
|
365
365
|
.pp-how p { margin: 0; color: var(--ink-soft); }
|
|
366
366
|
.pp-band .pp-figure { margin-top: var(--s6); }
|
|
367
367
|
|
|
@@ -377,11 +377,11 @@ body.pp { margin: 0; }
|
|
|
377
377
|
.pp-chapter > .pp-wrap { grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); }
|
|
378
378
|
.pp-chapter-body { grid-column: 2; }
|
|
379
379
|
}
|
|
380
|
-
.pp-label { margin: 0; padding-top: 0.4em; font: 500 var(--text-xs) / 1.4 var(--mono); letter-spacing:
|
|
380
|
+
.pp-label { margin: 0; padding-top: 0.4em; font: 500 var(--text-xs) / 1.4 var(--mono); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--ink-soft); }
|
|
381
381
|
.pp-label::before { content: counter(pp-chapter, decimal-leading-zero) " / "; color: var(--ink); }
|
|
382
382
|
.pp-chapter h2 {
|
|
383
|
-
font-size: clamp(var(--text-xl), 1rem + 2vw, var(--text-3xl)); font-weight:
|
|
384
|
-
letter-spacing: -
|
|
383
|
+
font-size: clamp(var(--text-xl), 1rem + 2vw, var(--text-3xl)); font-weight: var(--weight-semibold); line-height: var(--leading-display);
|
|
384
|
+
letter-spacing: var(--tracking-display); margin: 0 0 var(--s4); max-width: 22ch; text-wrap: balance;
|
|
385
385
|
}
|
|
386
386
|
.pp-chapter-body > p { margin: 0 0 var(--s4); max-width: 62ch; color: var(--ink-soft); font-size: var(--text-lg); line-height: 1.55; }
|
|
387
387
|
.pp-chapter-body > p:last-child { margin-bottom: 0; }
|
|
@@ -389,7 +389,7 @@ body.pp { margin: 0; }
|
|
|
389
389
|
/* Two to four short points under a chapter: a ruled column each. */
|
|
390
390
|
.pp-points { list-style: none; margin: var(--s6) 0 0; padding: 0; display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
|
|
391
391
|
.pp-points > li { border-top: 2px solid var(--ink); padding-top: var(--s3); }
|
|
392
|
-
.pp-points h3 { margin: 0 0 6px; font-size: var(--text-lg); font-weight:
|
|
392
|
+
.pp-points h3 { margin: 0 0 6px; font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-title); }
|
|
393
393
|
.pp-points p { margin: 0; color: var(--ink-soft); }
|
|
394
394
|
|
|
395
395
|
/* A chapter's figure: a terminal, a screenshot, a small mock of the product. */
|
|
@@ -405,7 +405,7 @@ body.pp { margin: 0; }
|
|
|
405
405
|
.pp-close { padding: var(--s8) 0 var(--s9); border-top: 1px solid var(--line); scroll-margin-top: 64px; }
|
|
406
406
|
.pp-close > .pp-wrap { display: grid; gap: var(--s6); grid-template-columns: minmax(0, 1fr); }
|
|
407
407
|
@media (min-width: 960px) { .pp-close > .pp-wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
|
|
408
|
-
.pp-close h2 { font-size: clamp(var(--text-xl), 1rem + 2vw, var(--text-3xl)); font-weight:
|
|
408
|
+
.pp-close h2 { font-size: clamp(var(--text-xl), 1rem + 2vw, var(--text-3xl)); font-weight: var(--weight-semibold); line-height: var(--leading-display); letter-spacing: var(--tracking-display); margin: var(--s4) 0 var(--s3); text-wrap: balance; }
|
|
409
409
|
.pp-close .pp-subhead { margin-bottom: 0; }
|
|
410
410
|
.pp-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: var(--s6); }
|
|
411
411
|
@media (max-width: 560px) { .pp-panel { padding: var(--s5) var(--s4); } }
|
|
@@ -428,8 +428,8 @@ body.pp { margin: 0; }
|
|
|
428
428
|
/* [hidden] is how the form gives way to .pp-done; display: grid would beat it. */
|
|
429
429
|
.pp-form[hidden], .pp-error[hidden], .pp-done[hidden] { display: none; }
|
|
430
430
|
.pp-field { display: grid; gap: 6px; min-width: 0; }
|
|
431
|
-
.pp-field > label { font-size: var(--text-sm); font-weight:
|
|
432
|
-
.pp-optional { font-weight:
|
|
431
|
+
.pp-field > label { font-size: var(--text-sm); font-weight: var(--weight-medium); line-height: var(--leading-ui); color: var(--ink); }
|
|
432
|
+
.pp-optional { font-weight: var(--weight-regular); color: var(--ink-soft); }
|
|
433
433
|
.pp-field input, .pp-field textarea {
|
|
434
434
|
box-sizing: border-box; width: 100%; margin: 0; min-width: 0;
|
|
435
435
|
font: var(--text-base) / 1.5 var(--sans); color: var(--ink);
|
|
@@ -445,11 +445,11 @@ body.pp { margin: 0; }
|
|
|
445
445
|
.pp-field input:focus-visible, .pp-field textarea:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
|
|
446
446
|
.pp-field input:disabled, .pp-field textarea:disabled { background: var(--surface-hover); color: var(--ink-soft); cursor: not-allowed; }
|
|
447
447
|
.pp-field [aria-invalid="true"], .pp-field [aria-invalid="true"]:hover { border-color: var(--danger); }
|
|
448
|
-
.pp-error { margin: 0; font-size: var(--text-sm); line-height:
|
|
448
|
+
.pp-error { margin: 0; font-size: var(--text-sm); line-height: var(--leading-ui); color: var(--danger-ink); }
|
|
449
449
|
/* A send error reuses the note under the button. */
|
|
450
450
|
.pp-note.is-error { color: var(--danger-ink); }
|
|
451
451
|
|
|
452
|
-
.pp-done h3 { margin: 0 0 var(--s2); font-size: var(--text-xl); font-weight:
|
|
452
|
+
.pp-done h3 { margin: 0 0 var(--s2); font-size: var(--text-xl); font-weight: var(--weight-semibold); line-height: 1.25; letter-spacing: -0.015em; }
|
|
453
453
|
.pp-done p { margin: 0; color: var(--ink-soft); }
|
|
454
454
|
.pp-done:focus { outline: none; }
|
|
455
455
|
.pp-done:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 4px; border-radius: var(--radius-sm); }
|
|
@@ -462,7 +462,7 @@ body.pp { margin: 0; }
|
|
|
462
462
|
own way in gets a plain link in its <dd>. */
|
|
463
463
|
.pp-price { margin: var(--s6) 0 0; display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
|
|
464
464
|
.pp-price > div { border-top: 2px solid var(--ink); padding-top: var(--s3); }
|
|
465
|
-
.pp-price dt { margin: 0 0 6px; font-size: var(--text-lg); font-weight:
|
|
465
|
+
.pp-price dt { margin: 0 0 6px; font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: var(--leading-title); letter-spacing: var(--tracking-title); }
|
|
466
466
|
.pp-price dd { margin: 0; font-size: var(--text-sm); color: var(--ink-soft); }
|
|
467
467
|
.pp-price dd a { color: var(--i-ink); }
|
|
468
468
|
|
|
@@ -480,3 +480,6 @@ body.pp { margin: 0; }
|
|
|
480
480
|
by the site's build, never typed and never written by client script. */
|
|
481
481
|
.pp-legal { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); font-size: var(--text-xs); }
|
|
482
482
|
.pp-legal small { font-size: inherit; }
|
|
483
|
+
|
|
484
|
+
/* Card and step headings balance their lines, like the band headings above. */
|
|
485
|
+
:where(.pp-get, .pp-compare, .pp-how, .pp-points, .pp-done) h3, .pp-price dt { text-wrap: balance; }
|
|
@@ -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
|
@@ -28,11 +28,16 @@
|
|
|
28
28
|
|
|
29
29
|
--color-interactive: var(--i);
|
|
30
30
|
--color-interactive-ink: var(--i-ink);
|
|
31
|
+
--color-interactive-ink-hover: var(--i-ink-hover);
|
|
31
32
|
--color-interactive-hover: var(--i-hover);
|
|
32
33
|
--color-interactive-pressed: var(--i-pressed);
|
|
33
34
|
--color-interactive-surface: var(--i-surface);
|
|
34
35
|
--color-interactive-line: var(--i-line);
|
|
35
36
|
--color-on-interactive: var(--on-i);
|
|
37
|
+
--color-danger-fill: var(--danger-fill);
|
|
38
|
+
--color-danger-fill-hover: var(--danger-fill-hover);
|
|
39
|
+
--color-danger-fill-pressed: var(--danger-fill-pressed);
|
|
40
|
+
--color-on-danger: var(--on-danger);
|
|
36
41
|
|
|
37
42
|
--color-success: var(--success);
|
|
38
43
|
--color-success-ink: var(--success-ink);
|
|
@@ -61,6 +66,13 @@
|
|
|
61
66
|
--color-diff-removed-ink: var(--diff-removed-ink);
|
|
62
67
|
--color-diff-removed-surface: var(--diff-removed-surface);
|
|
63
68
|
|
|
69
|
+
--color-code-surface: var(--code-surface);
|
|
70
|
+
--color-code-ink: var(--code-ink);
|
|
71
|
+
--color-code-keyword: var(--code-keyword);
|
|
72
|
+
--color-code-string: var(--code-string);
|
|
73
|
+
--color-code-comment: var(--code-comment);
|
|
74
|
+
--color-code-highlight: var(--code-highlight);
|
|
75
|
+
|
|
64
76
|
--color-mark: var(--mark);
|
|
65
77
|
--color-mark-ink: var(--mark-ink);
|
|
66
78
|
|
|
@@ -68,7 +80,23 @@
|
|
|
68
80
|
--font-mono: var(--mono);
|
|
69
81
|
--font-display: var(--display);
|
|
70
82
|
|
|
83
|
+
/* Weights match Tailwind's own, so font-medium and font-semibold are
|
|
84
|
+
unchanged. Leading and tracking are named by role, not tight/snug/…,
|
|
85
|
+
so they ADD leading-display, tracking-title and the rest and leave
|
|
86
|
+
Tailwind's leading-tight, tracking-tight and friends as they were. */
|
|
87
|
+
--font-weight-normal: var(--weight-regular);
|
|
88
|
+
--font-weight-medium: var(--weight-medium);
|
|
89
|
+
--font-weight-semibold: var(--weight-semibold);
|
|
90
|
+
--leading-display: var(--leading-display);
|
|
91
|
+
--leading-title: var(--leading-title);
|
|
92
|
+
--leading-ui: var(--leading-ui);
|
|
93
|
+
--leading-body: var(--leading-body);
|
|
94
|
+
--tracking-title: var(--tracking-title);
|
|
95
|
+
--tracking-display: var(--tracking-display);
|
|
96
|
+
--tracking-caps: var(--tracking-caps);
|
|
97
|
+
|
|
71
98
|
--radius-sm: var(--radius-sm);
|
|
99
|
+
--radius-control: var(--radius-control);
|
|
72
100
|
--radius: var(--radius);
|
|
73
101
|
--radius-lg: var(--radius-lg);
|
|
74
102
|
|