create-pmos 0.850.0 → 0.851.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/package.json +61 -36
- package/payload/KIT-VERSION +1 -1
- package/payload/design-system/brand/README.md +5 -3
- package/payload/design-system/brand/tokens.css +2 -2
- package/payload/design-system/brand/tokens.json +31 -31
- package/payload/design-system/charts/tokens.css +2 -2
- package/payload/design-system/charts/tokens.json +6 -6
- package/payload/design-system/documents/tokens.css +2 -2
- package/payload/design-system/documents/tokens.json +6 -6
- package/payload/design-system/slides/tokens.css +2 -2
- package/payload/design-system/slides/tokens.json +2 -2
- package/payload/design-system/ui/tokens.css +2 -2
- package/payload/design-system/ui/tokens.json +6 -6
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-insights-test.js +2 -2
- package/workspace/changelog.json +60 -4
- package/workspace/design-system/brand/README.md +5 -3
- package/workspace/design-system/brand/tokens.css +2 -2
- package/workspace/design-system/brand/tokens.json +31 -31
- package/workspace/design-system/charts/tokens.css +2 -2
- package/workspace/design-system/charts/tokens.json +6 -6
- package/workspace/design-system/documents/tokens.css +2 -2
- package/workspace/design-system/documents/tokens.json +6 -6
- package/workspace/design-system/slides/tokens.css +2 -2
- package/workspace/design-system/slides/tokens.json +2 -2
- package/workspace/design-system/ui/tokens.css +2 -2
- package/workspace/design-system/ui/tokens.json +6 -6
- package/workspace/guide/cli.md +9 -1
- package/workspace/guide/layout.md +2 -0
- package/workspace/lib/balance-target.js +13 -6
- package/workspace/lib/design-boards.js +182 -0
- package/workspace/lib/design-cli.js +28 -5
- package/workspace/lib/design-drift.js +26 -2
- package/workspace/lib/routes-drift.js +2 -2
- package/workspace/lib/spec-code-drift.js +2 -2
- package/workspace/lib/{routes-spec-drift.js → spec-drift-http.js} +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-vw-doc-test.js +1 -1
- package/workspace/public/pm/brand.css +2 -2
- package/workspace/public/pm/charts.css +2 -2
- package/workspace/public/pm/cozy-viewer.css +8 -8
- package/workspace/public/pm/documents.css +2 -2
- package/workspace/public/pm/ds-bridge.css +16 -0
- package/workspace/public/pm/komorebi.css +2 -2
- package/workspace/public/pm/slides.css +2 -2
- package/workspace/test-lists/text-token-guard.json +5 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* design-boards.js — `pmos design boards`: the design-token check for canvas boards (*.dc.html), initiative text-token-guard.
|
|
3
|
+
*
|
|
4
|
+
* Why it exists. Wawan, 2026-11-25: "I thought we have design system which guard the design to make it consistent". The drift guard reads the
|
|
5
|
+
* repository only, so a canvas board never passed through it. The Goals boards (Exploring 3, page goalstack) wrote their own colour values
|
|
6
|
+
* into their :root block and hand-wrote text sizes off the type scale (12, 14, 22, 24, 28 px). A board can only be held to the system by a
|
|
7
|
+
* check that the design threads run on the board files before they publish, and by --fix, which puts a board back on the system.
|
|
8
|
+
*
|
|
9
|
+
* A board passes when:
|
|
10
|
+
* 1. every colour or shadow token its <style> blocks define has the design system's value for that theme (:root / [data-theme="light"]
|
|
11
|
+
* is light, [data-theme="dark"] is dark), and it defines no colour token the system does not have;
|
|
12
|
+
* 2. no style attribute and no other style rule holds a literal colour (#hex, rgb(), hsl());
|
|
13
|
+
* 3. every font-size reads a type token (var(--type-…)) or is one of the type scale's sizes (13, 15, 18, 26 px in PMOS Komorebi).
|
|
14
|
+
*
|
|
15
|
+
* check(html, sys) PURE → [{ kind, line, say }] · fix(html, sys) PURE → { html, changed } · systemFrom(dir) → sys
|
|
16
|
+
* run({ files, fix, say, dir }) → exit code (0 every board passes, 1 a board fails, 2 usage)
|
|
17
|
+
* sys = { light: { name: value }, dark: { name: value }, type: [{ name, size, line }] }. Token names have no leading --.
|
|
18
|
+
*/
|
|
19
|
+
const fs = require('fs');
|
|
20
|
+
const path = require('path');
|
|
21
|
+
|
|
22
|
+
const COLOUR = /#[0-9a-fA-F]{3,8}\b|\b(?:rgba?|hsla?)\([^()]*\)/g;
|
|
23
|
+
const hasColour = (v) => { COLOUR.lastIndex = 0; const hit = COLOUR.test(String(v)); COLOUR.lastIndex = 0; return hit; };
|
|
24
|
+
const norm = (v) => String(v).toLowerCase().replace(/\s+/g, '');
|
|
25
|
+
|
|
26
|
+
/** The system's colour, shadow and type values from a design-system folder (brand/ and ui/ tokens.json). */
|
|
27
|
+
function systemFrom(dir) {
|
|
28
|
+
const read = (s) => JSON.parse(fs.readFileSync(path.join(dir, s, 'tokens.json'), 'utf8'));
|
|
29
|
+
const brand = read('brand'); const ui = read('ui');
|
|
30
|
+
const light = {}; const dark = {};
|
|
31
|
+
const put = (t) => {
|
|
32
|
+
if (t.value && typeof t.value === 'object') { light[t.name] = t.value.light; dark[t.name] = t.value.dark; } else { light[t.name] = t.value; dark[t.name] = t.value; }
|
|
33
|
+
};
|
|
34
|
+
for (const t of (brand.color && brand.color.tokens) || []) put(t);
|
|
35
|
+
for (const t of (ui.shadow && ui.shadow.tokens) || []) put(t);
|
|
36
|
+
// ground-night is the dark ground: a board's dark block uses it as --ground-night, so dark and light agree
|
|
37
|
+
const type = [];
|
|
38
|
+
for (const g of (ui.type && ui.type.groups) || []) for (const st of g.styles || []) {
|
|
39
|
+
if (st.family === 'mono') continue;
|
|
40
|
+
type.push({ name: 'type-' + st.name, size: parseFloat(st.fontSize), line: st.lineHeight });
|
|
41
|
+
}
|
|
42
|
+
type.sort((a, b) => a.size - b.size);
|
|
43
|
+
return { light, dark, type };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Which theme a token block's selector is: 'light', 'dark' or null (not a token block). */
|
|
47
|
+
function themeOf(selector) {
|
|
48
|
+
const s = String(selector);
|
|
49
|
+
if (/data-theme\s*=\s*["']?dark/.test(s)) return 'dark';
|
|
50
|
+
if (/^\s*:root\b|data-theme\s*=\s*["']?light/.test(s)) return 'light';
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const lineAt = (text, i) => text.slice(0, i).split('\n').length;
|
|
55
|
+
|
|
56
|
+
/** Every <style> block's rules: [{ selector, body, start (index of body in html) }]. Flat rules and @media are walked one level. */
|
|
57
|
+
function styleRules(html) {
|
|
58
|
+
const out = [];
|
|
59
|
+
for (const m of html.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi)) {
|
|
60
|
+
const base = m.index + m[0].indexOf(m[1]);
|
|
61
|
+
const css = m[1];
|
|
62
|
+
const re = /([^{}]+)\{([^{}]*)\}/g;
|
|
63
|
+
let r;
|
|
64
|
+
while ((r = re.exec(css))) out.push({ selector: r[1].replace(/^[\s\S]*\{/, '').trim(), body: r[2], start: base + r.index + r[0].indexOf('{') + 1 });
|
|
65
|
+
}
|
|
66
|
+
return out;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** The nearest type step for a size in px: the scale is the system's, so a 12 px line becomes small (13) and 14 px becomes body (15). */
|
|
70
|
+
function stepFor(px, type) {
|
|
71
|
+
if (!type.length) return null;
|
|
72
|
+
let best = type[0];
|
|
73
|
+
for (const t of type) if (Math.abs(t.size - px) < Math.abs(best.size - px) || (Math.abs(t.size - px) === Math.abs(best.size - px) && t.size > best.size)) best = t;
|
|
74
|
+
return best;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Findings for one board. PURE. */
|
|
78
|
+
function check(html, sys) {
|
|
79
|
+
const out = [];
|
|
80
|
+
const scale = new Set(sys.type.map((t) => t.size));
|
|
81
|
+
const known = new Set(Object.keys(sys.light));
|
|
82
|
+
const tokenSpans = [];
|
|
83
|
+
for (const r of styleRules(html)) {
|
|
84
|
+
const theme = themeOf(r.selector);
|
|
85
|
+
if (theme) tokenSpans.push([r.start, r.start + r.body.length]);
|
|
86
|
+
for (const d of r.body.matchAll(/(--?[a-zA-Z][a-zA-Z0-9-]*)\s*:\s*([^;]+)/g)) {
|
|
87
|
+
const prop = d[1]; const value = d[2].trim(); const line = lineAt(html, r.start + d.index);
|
|
88
|
+
if (prop.startsWith('--')) {
|
|
89
|
+
const name = prop.slice(2);
|
|
90
|
+
if (!theme) { if (hasColour(value)) out.push({ kind: 'colour', line, say: `${prop} is defined outside the board's token block with a colour (${value})` }); continue; }
|
|
91
|
+
if (known.has(name)) {
|
|
92
|
+
const want = sys[theme][name];
|
|
93
|
+
if (want != null && norm(want) !== norm(value)) out.push({ kind: 'token', line, say: `${prop} (${theme}) is ${value}; the design system's value is ${want}` });
|
|
94
|
+
} else if (hasColour(value)) out.push({ kind: 'token', line, say: `${prop} is a colour token the design system does not have (${value})` });
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
if (!theme && hasColour(value.replace(/var\([^()]*\)/g, ''))) out.push({ kind: 'colour', line, say: `${prop}: ${value} is a literal colour; read a token (--ink, --muted, --blue, --alert …)` });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const inToken = (i) => tokenSpans.some(([a, b]) => i >= a && i < b);
|
|
101
|
+
for (const m of html.matchAll(/\bstyle\s*=\s*"([^"]*)"/g)) {
|
|
102
|
+
const at = m.index; const v = m[1];
|
|
103
|
+
if (inToken(at)) continue;
|
|
104
|
+
const line = lineAt(html, at);
|
|
105
|
+
for (const c of v.replace(/var\([^()]*\)/g, '').matchAll(COLOUR)) out.push({ kind: 'colour', line, say: `literal colour ${c[0]} in a style attribute; read a token` });
|
|
106
|
+
}
|
|
107
|
+
for (const m of html.matchAll(/font-size\s*:\s*([^;"}]+)/g)) {
|
|
108
|
+
if (inToken(m.index)) continue;
|
|
109
|
+
const v = m[1].trim();
|
|
110
|
+
if (/^var\(--type-/.test(v) || /^(inherit|initial|unset|100%|1em)$/.test(v)) continue;
|
|
111
|
+
const px = v.match(/^(\d*\.?\d+)px$/);
|
|
112
|
+
if (px && scale.has(Number(px[1]))) continue;
|
|
113
|
+
const step = px ? stepFor(Number(px[1]), sys.type) : null;
|
|
114
|
+
out.push({ kind: 'size', line: lineAt(html, m.index), say: `font-size ${v} is not on the type scale (${[...scale].join(', ')} px)${step ? `; nearest is var(--${step.name}) ${step.size}px` : ''}` });
|
|
115
|
+
}
|
|
116
|
+
return out.sort((a, b) => a.line - b.line);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** Put a board back on the system. PURE. Token blocks take the system's values (and gain the --type-* tokens); every font-size in px
|
|
120
|
+
* becomes the nearest type token, and a line-height in the same declaration list becomes that step's. Literal colours elsewhere are left
|
|
121
|
+
* for a person: their meaning (ink, muted, alert) cannot be guessed. */
|
|
122
|
+
function fix(html, sys) {
|
|
123
|
+
let out = html;
|
|
124
|
+
// 1. token blocks
|
|
125
|
+
const rules = styleRules(out).filter((r) => themeOf(r.selector)).sort((a, b) => b.start - a.start);
|
|
126
|
+
for (const r of rules) {
|
|
127
|
+
const theme = themeOf(r.selector);
|
|
128
|
+
let body = r.body.replace(/(--([a-zA-Z][a-zA-Z0-9-]*))\s*:\s*([^;]+)/g, (all, prop, name, value) => {
|
|
129
|
+
const want = sys[theme][name];
|
|
130
|
+
return want != null && norm(want) !== norm(value) ? `${prop}:${want}` : all;
|
|
131
|
+
});
|
|
132
|
+
if (theme === 'light' && /^\s*:root\b/.test(r.selector) && sys.type.length && !/--type-/.test(body) && /--font-sans|--ink/.test(body)) {
|
|
133
|
+
body = body.replace(/;?\s*$/, '') + ';' + sys.type.map((t) => `--${t.name}:${t.size}px;--${t.name}-line:${t.line}`).join(';');
|
|
134
|
+
}
|
|
135
|
+
out = out.slice(0, r.start) + body + out.slice(r.start + r.body.length);
|
|
136
|
+
}
|
|
137
|
+
// 2. font sizes, in style attributes and style rules alike
|
|
138
|
+
const decl = (list) => {
|
|
139
|
+
let lineStep = null;
|
|
140
|
+
let next = list.replace(/font-size\s*:\s*(\d*\.?\d+)px/g, (all, n) => {
|
|
141
|
+
const step = stepFor(Number(n), sys.type);
|
|
142
|
+
if (!step) return all;
|
|
143
|
+
if (Number(n) !== step.size) lineStep = step;
|
|
144
|
+
return `font-size:var(--${step.name})`;
|
|
145
|
+
});
|
|
146
|
+
if (lineStep) next = next.replace(/line-height\s*:\s*\d*\.?\d+px/g, `line-height:var(--${lineStep.name}-line)`);
|
|
147
|
+
return next;
|
|
148
|
+
};
|
|
149
|
+
out = out.replace(/\bstyle\s*=\s*"([^"]*)"/g, (all, v) => `style="${decl(v)}"`);
|
|
150
|
+
out = out.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi, (block) => block.replace(/\{([^{}]*)\}/g, (all, body) => `{${decl(body)}}`));
|
|
151
|
+
return { html: out, changed: out !== html };
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function listFiles(paths) {
|
|
155
|
+
const out = [];
|
|
156
|
+
for (const p of paths) {
|
|
157
|
+
if (!fs.existsSync(p)) { out.push({ missing: p }); continue; }
|
|
158
|
+
if (fs.statSync(p).isDirectory()) { for (const f of fs.readdirSync(p).sort()) if (f.endsWith('.dc.html')) out.push({ file: path.join(p, f) }); } else out.push({ file: p });
|
|
159
|
+
}
|
|
160
|
+
return out;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function run({ files, write = false, say = (s) => console.log(s), dir = path.join(__dirname, '..', 'design-system') } = {}) {
|
|
164
|
+
if (!files || !files.length) { say('✗ usage: pmos design boards <board.dc.html | folder>… [--fix]'); return 2; }
|
|
165
|
+
const sys = systemFrom(dir);
|
|
166
|
+
let failed = 0; let fixed = 0;
|
|
167
|
+
for (const f of listFiles(files)) {
|
|
168
|
+
if (f.missing) { say(`✗ ${f.missing}: no such file or folder`); failed++; continue; }
|
|
169
|
+
let html = fs.readFileSync(f.file, 'utf8');
|
|
170
|
+
if (write) { const r = fix(html, sys); if (r.changed) { fs.writeFileSync(f.file, r.html); html = r.html; fixed++; } }
|
|
171
|
+
const found = check(html, sys);
|
|
172
|
+
if (!found.length) { say(`✓ ${f.file}`); continue; }
|
|
173
|
+
failed++;
|
|
174
|
+
say(`✗ ${f.file}: ${found.length} place${found.length === 1 ? '' : 's'} outside the design system`);
|
|
175
|
+
for (const x of found.slice(0, 12)) say(` line ${x.line}: ${x.say}`);
|
|
176
|
+
if (found.length > 12) say(` … ${found.length - 12} more`);
|
|
177
|
+
}
|
|
178
|
+
if (write) say(`${fixed} board${fixed === 1 ? '' : 's'} changed by --fix.`);
|
|
179
|
+
return failed ? 1 : 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
module.exports = { systemFrom, themeOf, styleRules, stepFor, check, fix, run };
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
* --gate exit 1 when a count rose against --base
|
|
14
14
|
* --github print each new bypass as a GitHub warning on its file and line (the CI step uses it)
|
|
15
15
|
* --pages the older view instead: each page's share of system classes and its own CSS (a measure only)
|
|
16
|
+
* --block-text exit 1 when an added line gives text a colour or size the design system does not own (CI blocks on it; the other kinds warn)
|
|
17
|
+
*
|
|
18
|
+
* pmos design boards <board.dc.html | folder>… [--fix] (initiative text-token-guard, lib/design-boards.js) a canvas board's colour tokens,
|
|
19
|
+
* literal colours and text sizes against the design system. Design threads run it on every board before they publish.
|
|
16
20
|
*
|
|
17
21
|
* pmos design swap [--write] (initiative token-swap-same-value, lib/design-swap.js) each fixed spacing or corner value in a scanned
|
|
18
22
|
* stylesheet that equals a design token: counted per file, or with --write replaced by that token. Nothing on screen moves.
|
|
@@ -23,10 +27,11 @@ const fs = require('fs');
|
|
|
23
27
|
const path = require('path');
|
|
24
28
|
const D = require('./design-drift.js');
|
|
25
29
|
|
|
26
|
-
const COMMANDS = { design: ['drift', 'swap'] };
|
|
30
|
+
const COMMANDS = { design: ['drift', 'swap', 'boards'] };
|
|
27
31
|
const USAGE = [
|
|
28
32
|
'usage: pmos design drift — every place your styles and scripts do not read a design token, and which ones a change adds',
|
|
29
|
-
' pmos design drift [--ref <ref>] [--base <ref>|week] [--weeks <n>] [--json] [--write] [--gate] [--github] [--pages]',
|
|
33
|
+
' pmos design drift [--ref <ref>] [--base <ref>|week] [--weeks <n>] [--json] [--write] [--gate] [--github] [--pages] [--block-text]',
|
|
34
|
+
' --block-text fail when a change adds a text colour or size outside the design system (literal colour or text size, or a colour token defined outside the system sheets)',
|
|
30
35
|
' --ref <ref> the commit to count (default HEAD; WORKTREE reads the files on disk)',
|
|
31
36
|
' --base <ref> compare with this commit and name each added line that bypasses a token; "week" is the last commit a week earlier',
|
|
32
37
|
' --weeks <n> the total at the end of each of the last n weeks (1 to 12)',
|
|
@@ -35,10 +40,11 @@ const USAGE = [
|
|
|
35
40
|
' --github print each new bypass as a GitHub warning on its line',
|
|
36
41
|
' --pages each page\'s share of system classes instead (a measure only)',
|
|
37
42
|
'It reads git only. A product sets its files and system sheets in design-drift.json in its design-system folder.',
|
|
43
|
+
' pmos design boards <board.dc.html | folder>… [--fix] check canvas boards: colour tokens with the system\'s values, no literal colours, text sizes on the type scale; --fix puts a board back on the system',
|
|
38
44
|
' pmos design swap [--write] each fixed spacing or corner value that equals a design token: counted, or with --write replaced by the token',
|
|
39
45
|
];
|
|
40
|
-
const FLAGS = new Set(['ref', 'base', 'weeks', 'json', 'write', 'gate', 'repo', 'github', 'pages']);
|
|
41
|
-
const BOOL = new Set(['json', 'write', 'gate', 'github', 'pages']);
|
|
46
|
+
const FLAGS = new Set(['ref', 'base', 'weeks', 'json', 'write', 'gate', 'repo', 'github', 'pages', 'block-text']);
|
|
47
|
+
const BOOL = new Set(['json', 'write', 'gate', 'github', 'pages', 'block-text', 'fix']);
|
|
42
48
|
|
|
43
49
|
function parse(args) {
|
|
44
50
|
const pos = [], flags = {};
|
|
@@ -64,6 +70,11 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), now
|
|
|
64
70
|
if (!sub || ['help', '--help', '-h'].includes(sub)) { for (const l of USAGE) say(l); return sub ? 0 : 2; }
|
|
65
71
|
if (!COMMANDS.design.includes(sub)) { say(`unknown design command "${sub}". Use one of: ${COMMANDS.design.join(', ')}`); return 2; }
|
|
66
72
|
const { pos, flags } = parse(args.slice(1));
|
|
73
|
+
if (sub === 'boards') {
|
|
74
|
+
const bad = Object.keys(flags).filter((k) => k !== 'fix');
|
|
75
|
+
if (!pos.length || bad.length) { say('✗ usage: pmos design boards <board.dc.html | folder>… [--fix]'); return 2; }
|
|
76
|
+
return require('./design-boards.js').run({ files: pos.map((p) => path.resolve(cwd, p)), write: 'fix' in flags, say });
|
|
77
|
+
}
|
|
67
78
|
if (sub === 'swap') {
|
|
68
79
|
const bad = Object.keys(flags).filter((k) => k !== 'write' && k !== 'repo');
|
|
69
80
|
if (pos.length || bad.length) { say('✗ usage: pmos design swap [--write]'); return 2; }
|
|
@@ -79,6 +90,7 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), now
|
|
|
79
90
|
if (!Number.isInteger(weeks) || weeks < 0 || weeks > 12) { say('✗ --weeks is a whole number from 1 to 12'); return 2; }
|
|
80
91
|
if (flags.gate && !flags.base) { say('✗ --gate needs --base: it fails only a count that rose against an earlier commit'); return 2; }
|
|
81
92
|
if (flags.github && !flags.base) { say('✗ --github needs --base: it marks only the lines a change added'); return 2; }
|
|
93
|
+
if (flags['block-text'] && !flags.base) { say('✗ --block-text needs --base: it fails only the text colours and sizes a change added'); return 2; }
|
|
82
94
|
|
|
83
95
|
const repo = repoRoot(flags.repo ? path.resolve(cwd, flags.repo) : cwd);
|
|
84
96
|
if (!repo) { say('✗ this is not a git repository. Run pmos design drift in your product\'s repository.'); return 1; }
|
|
@@ -160,10 +172,16 @@ function tokens({ repo, ref, base, worktree, weeks, flags, say, now }) {
|
|
|
160
172
|
}
|
|
161
173
|
if (trend) say('By week: ' + trend.map((t) => `${t.week} ${t.total == null ? '–' : n(t.total)}`).join(' · '));
|
|
162
174
|
}
|
|
175
|
+
const blocked = flags['block-text'] && findings ? D.textBlock(findings, head.colourTokens) : [];
|
|
176
|
+
const isBlocked = (g, x) => flags['block-text'] && D.isTextFinding(x, head.colourTokens);
|
|
163
177
|
if (flags.github && findings) {
|
|
164
178
|
for (const g of findings) {
|
|
165
179
|
if (!g.lines.length) { say(`::warning file=${g.file},title=Design tokens::${D.KIND_LABEL[g.kind]} count ${g.before} → ${g.after}`); continue; }
|
|
166
|
-
for (const x of g.lines)
|
|
180
|
+
for (const x of g.lines) {
|
|
181
|
+
const level = isBlocked(g, x) ? 'error' : 'warning';
|
|
182
|
+
const why = level === 'error' ? ' (text colour or size outside the design system: this fails the check)' : '';
|
|
183
|
+
say(`::${level} file=${g.file},line=${x.line},title=Design tokens::${D.findingSay(x).replace(/[\r\n%]/g, ' ')}${why}`);
|
|
184
|
+
}
|
|
167
185
|
}
|
|
168
186
|
if (!findings.length) say(`No new token bypasses against ${before.commit}.`);
|
|
169
187
|
}
|
|
@@ -173,6 +191,11 @@ function tokens({ repo, ref, base, worktree, weeks, flags, say, now }) {
|
|
|
173
191
|
fs.writeFileSync(file, D.tokensMd({ date, ref, now: head, base, baseCommit: before && before.commit, findings, trend, cmd }));
|
|
174
192
|
if (!flags.json && !flags.github) say('Report: ' + path.relative(repo, file));
|
|
175
193
|
}
|
|
194
|
+
if (blocked.length) {
|
|
195
|
+
const n1 = blocked.reduce((a, g) => a + g.lines.length, 0);
|
|
196
|
+
say(`✗ ${n1} added line${n1 === 1 ? '' : 's'} give text a colour or size outside the design system. Read a token instead: --ink, --muted, --blue, --alert for colour; --type-small, --type-body, --type-heading, --type-title for size. A new colour or size goes into design-system/brand or design-system/ui first.`);
|
|
197
|
+
return 1;
|
|
198
|
+
}
|
|
176
199
|
return flags.gate && findings && findings.length ? 1 : 0;
|
|
177
200
|
}
|
|
178
201
|
|
|
@@ -583,7 +583,31 @@ function bypasses(repo, ref, { files: given } = {}) {
|
|
|
583
583
|
files.push({ file: f, counts, findings });
|
|
584
584
|
}
|
|
585
585
|
const commit = given ? null : (isWorktree(ref) ? 'WORKTREE' : (gitOut(repo, ['rev-parse', '--short', ref]) || '').trim() || null);
|
|
586
|
-
|
|
586
|
+
const colourTokens = [...tokens.entries()].filter(([, v]) => { COLOUR.lastIndex = 0; return COLOUR.test(v); }).map(([n]) => n);
|
|
587
|
+
COLOUR.lastIndex = 0;
|
|
588
|
+
return { ref: isWorktree(ref) ? 'WORKTREE' : ref, commit, config: cfg, tokens: tokens.size, colourTokens, files, totals, total: Object.values(totals).reduce((a, b) => a + b, 0), swaps };
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
// ── the text block (Wawan 2026-11-25: "I thought we have design system which guard the design to make it consistent") ─────────────────
|
|
592
|
+
// The ratchet above only warns. These added lines fail the check, because each one gives text a colour or a size the design system does not
|
|
593
|
+
// own: a literal colour, a literal text size, an inline style with either, and a token that defines a colour outside the system sheets
|
|
594
|
+
// (a second palette, such as --nz-ink, or a page giving --ink its own value).
|
|
595
|
+
/** Is one finding a text colour or size outside the system? colourTokens = the system's colour token names (--ink …). PURE. */
|
|
596
|
+
function isTextFinding(x, colourTokens) {
|
|
597
|
+
if (x.kind === 'colour' || x.kind === 'size') return true;
|
|
598
|
+
const hasColour = (v) => { COLOUR.lastIndex = 0; const hit = COLOUR.test(String(v)); COLOUR.lastIndex = 0; return hit; };
|
|
599
|
+
if (x.kind === 'tokenDef') return hasColour(x.value) || new Set(colourTokens || []).has(x.prop);
|
|
600
|
+
if (x.kind === 'inline') return hasColour(x.value) || /font-size\s*:\s*-?\d*\.?\d+(px|rem|em)/.test(String(x.value));
|
|
601
|
+
return false;
|
|
602
|
+
}
|
|
603
|
+
/** The ratchet's findings that the text block fails: [{ file, kind, lines }] with only the text lines kept. PURE. */
|
|
604
|
+
function textBlock(findings, colourTokens) {
|
|
605
|
+
const out = [];
|
|
606
|
+
for (const g of findings || []) {
|
|
607
|
+
const lines = g.lines.filter((x) => isTextFinding(x, colourTokens));
|
|
608
|
+
if (lines.length) out.push({ ...g, lines });
|
|
609
|
+
}
|
|
610
|
+
return out;
|
|
587
611
|
}
|
|
588
612
|
|
|
589
613
|
/** The lines a commit range added to one file (base → head; head WORKTREE compares with the files on disk). */
|
|
@@ -668,6 +692,6 @@ function tokenTrend(repo, ref, weeks, { now = Date.now() } = {}) {
|
|
|
668
692
|
module.exports = {
|
|
669
693
|
DEFAULTS, CONFIG_PLACES, REBUILT_SHARE, REBUILT_SHRINK,
|
|
670
694
|
rulesOf, selectorClasses, splitSelectors, compoundsOf, systemOf, classesOf, importsOf, colourCount, globRe, resolveRef,
|
|
671
|
-
KINDS, KIND_LABEL, dropVars, tokensOf, tokenFor, cssBypasses, scriptBypasses, systemClassesAll, readMany, bypasses, addedLines, ratchet, findingSay, tokensMd, tokenTrend,
|
|
695
|
+
KINDS, KIND_LABEL, isTextFinding, textBlock, dropVars, tokensOf, tokenFor, cssBypasses, scriptBypasses, systemClassesAll, readMany, bypasses, addedLines, ratchet, findingSay, tokensMd, tokenTrend,
|
|
672
696
|
configAt, readerOf, measure, compare, queue, meanShare, trend, summary, reportMd, gitOut,
|
|
673
697
|
};
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* GET /api/drift/slip?ws=<id> → { ok, ws, name, notRead, today, initiatives, tasks, days, unsourced_days } open tasks behind
|
|
14
14
|
* their first plan (initiative slip-baseline-contradictions, lib/plan-baseline.js); read-only
|
|
15
15
|
* GET /api/drift/contradictions?ws=<id> → { ok, ws, name, notRead, items, total } records that disagree (lib/contradictions.js); read-only
|
|
16
|
-
* /api/spec-drift[/act|/undo] Library › Drift: specs and code that no longer match (lib/
|
|
16
|
+
* /api/spec-drift[/act|/undo] Library › Drift: specs and code that no longer match (lib/spec-drift-http.js, which says what each does)
|
|
17
17
|
*
|
|
18
18
|
* THE SWITCH. PMOS_DRIFT=off, or the shared guard's switch (lib/ai-guard.js off: PMOS_AI, the ai settings): every GET answers { ok, on: false }
|
|
19
19
|
* and every POST 409. WHO WRITES: a POST that carries an agent session header is refused (403); pm-guard requirePagePress checks the page. */
|
|
@@ -32,7 +32,7 @@ function isOn(ctx) {
|
|
|
32
32
|
|
|
33
33
|
async function handle(req, res, url, ctx) {
|
|
34
34
|
// Library › Drift, spec and code (initiative spec-code-drift): its own module, under this module's place in the route table
|
|
35
|
-
if (url.pathname === '/api/spec-drift' || url.pathname.startsWith('/api/spec-drift/')) return require('./
|
|
35
|
+
if (url.pathname === '/api/spec-drift' || url.pathname.startsWith('/api/spec-drift/')) return require('./spec-drift-http.js').handle(req, res, url, ctx);
|
|
36
36
|
const send = (r) => { ctx.json(res, r.body, r.status); return true; };
|
|
37
37
|
const what = url.pathname.replace(/^\/api\/drift\/?/, '');
|
|
38
38
|
const dir = D.dirOf(ctx.runtimeDir);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/* spec-code-drift.js — "Spec and code no longer match" (initiative spec-code-drift, idea A495): once a week, every merged spec (each
|
|
3
3
|
* initiative's done test) is compared with the code as it is now. THE PURE CORE, THE GIT READ and THE ONE WRITER of
|
|
4
|
-
* <runtime>/spec-drift/spec-drift.jsonl. lib/
|
|
4
|
+
* <runtime>/spec-drift/spec-drift.jsonl. lib/spec-drift-http.js shows it in Library › Drift; `pmos drift spec` (lib/drift-cli.js) reads
|
|
5
5
|
* and writes the same ledger.
|
|
6
6
|
*
|
|
7
7
|
* WHAT IS COMPARED (structured, no model). A spec is a done test in markdown whose rows name the files that prove them (`x.test.js`
|
|
@@ -326,7 +326,7 @@ function workOf(it, what) {
|
|
|
326
326
|
|
|
327
327
|
module.exports = { TAG, proofLines, KINDS, LEDGER, specsOf, rowsOf, refsOf, pathsIn, compare, check, lineOf, datesOf, weekOf, dirOf, read, append, fold, view, workOf, isTest };
|
|
328
328
|
|
|
329
|
-
// `node lib/spec-code-drift.js <repository>`: the check of one repository as JSON (lib/
|
|
329
|
+
// `node lib/spec-code-drift.js <repository>`: the check of one repository as JSON (lib/spec-drift-http.js calls check() in a worker thread).
|
|
330
330
|
if (require.main === module) {
|
|
331
331
|
let out;
|
|
332
332
|
try { out = check(path.resolve(process.argv[2] || process.cwd())); } catch (e) { out = { ok: false, error: String((e && e.message) || e).slice(0, 200) }; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
/*
|
|
2
|
+
/* spec-drift-http.js — Library › Drift: "Spec and code no longer match" over HTTP (initiative spec-code-drift, idea A495; lib/spec-code-drift.js).
|
|
3
3
|
* lib/routes-drift.js hands it every /api/spec-drift request, so the route table does not change.
|
|
4
4
|
*
|
|
5
5
|
* GET /api/spec-drift → { ok, on, specs, compared, drifted, rows, running } this week's mismatches of every open
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.851.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.851.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -240,7 +240,7 @@ const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', {
|
|
|
240
240
|
}, [V, w < 600]);
|
|
241
241
|
ok(`D8 at ${w} px ${theme}: no sideways scroll, no small target, nothing past the edge, role sizes only`, f.sx <= 0 && f.bad.length === 0 && f.out === 0 && f.fs.every((x) => ['13px', '15px', '16px', '18px', '26px'].includes(x)), JSON.stringify(f));
|
|
242
242
|
const c = await R.page.evaluate((v) => { const e = document.querySelector(v + ' .cf'); return [getComputedStyle(document.querySelector('#czViewer')).backgroundColor, getComputedStyle(e).color]; }, V); // the page sits on the Viewer's card
|
|
243
|
-
ok(`D8 at ${w} px ${theme}: the page follows the theme`, theme === 'dark' ? c[0] === 'rgb(
|
|
243
|
+
ok(`D8 at ${w} px ${theme}: the page follows the theme`, theme === 'dark' ? c[0] === 'rgb(24, 24, 27)' && c[1] === 'rgb(250, 250, 250)' : c[0] === 'rgb(255, 255, 255)' && c[1] === 'rgb(24, 24, 27)', JSON.stringify(c)); // Today is a pm-ds page: the Viewer's card and its text are the design system's card and ink (text-token-guard, one colour set)
|
|
244
244
|
await R.ctx.close();
|
|
245
245
|
}
|
|
246
246
|
finish();
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* so the sheet changes nothing until a page puts the class on its root. Load brand.css, then charts.css, then the system's own sheet. */
|
|
4
4
|
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/vendor/plus-jakarta-sans-var.woff2) format('woff2'); }
|
|
5
5
|
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/vendor/ibm-plex-mono-400.woff2) format('woff2'); }
|
|
6
|
-
:is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds){--ground:#
|
|
7
|
-
:is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds).dark, html.dark :is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds), :root[data-theme="dark"] :is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds){--ground:#
|
|
6
|
+
:is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds){--ground:#F4F4F5;--ground-morning:#F4F4F5;--ground-afternoon:#F4F4F5;--ground-evening:#F4F4F5;--ground-night:#09090B;--card:#FFFFFF;--well:#F4F4F5;--line:#E4E4E7;--ink:#18181B;--muted:#6B6B74;--blue:#2F4FD8;--on-blue:#FFFFFF;--blue-tint:#EEF2FF;--leaf:#2F4FD8;--leaf-tint:#EEF2FF;--alert:#B91C1C;--alert-tint:#FEF2F2}
|
|
7
|
+
:is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds).dark, html.dark :is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds), :root[data-theme="dark"] :is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds){--ground:#09090B;--card:#18181B;--well:#1F1F23;--line:#27272A;--ink:#FAFAFA;--muted:#A1A1AA;--blue:#8EA2FF;--on-blue:#09090B;--blue-tint:#1E2440;--leaf:#8EA2FF;--leaf-tint:#1E2440;--alert:#F87171;--alert-tint:#2A1717}
|
|
8
8
|
:is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds){--duration-quick:120ms;--duration-enter:200ms;--duration-leaf:600ms;--duration-light:20min;--ease-out:cubic-bezier(.2, .7, .2, 1);--ease-drift:cubic-bezier(.4, 0, .2, 1);--font-sans:"Plus Jakarta Sans", system-ui, sans-serif;--font-mono:"IBM Plex Mono", ui-monospace, monospace}
|
|
9
9
|
:root[data-daytint="morning"]:not([data-theme="dark"]) :is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds){--ground:var(--ground-morning)}
|
|
10
10
|
:root[data-daytint="afternoon"]:not([data-theme="dark"]) :is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds){--ground:var(--ground-afternoon)}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* charts.css: PMOS Charts, from the PMOS design system family, for the workspace. GENERATED from workspace/design-system/charts/ by
|
|
2
2
|
* lib/design-system.js: do not edit; change the system's files and run `node lib/design-system.js --write`. Every rule is scoped to :is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds),
|
|
3
3
|
* so the sheet changes nothing until a page puts the class on its root. Load brand.css, then charts.css, then the system's own sheet. */
|
|
4
|
-
:is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds){--chart-read:var(--blue);--chart-done:var(--leaf);--chart-plan:var(--muted);--chart-risk:var(--alert);--chart-rest:#C9CDD3;--chart-grid:var(--line);--diagram-step:var(--card);--diagram-edge:var(--muted);--diagram-lane:var(--well);--diagram-now:var(--leaf);--raise:0 1px 2px rgba(
|
|
5
|
-
:is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds).dark, html.dark :is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds), :root[data-theme="dark"] :is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds){--chart-rest:#4A4F57;--raise:0 1px 2px rgba(0,0,0,.4)
|
|
4
|
+
:is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds){--chart-read:var(--blue);--chart-done:var(--leaf);--chart-plan:var(--muted);--chart-risk:var(--alert);--chart-rest:#C9CDD3;--chart-grid:var(--line);--diagram-step:var(--card);--diagram-edge:var(--muted);--diagram-lane:var(--well);--diagram-now:var(--leaf);--raise:0 1px 2px rgba(0,0,0,.06);--lift:0 1px 3px rgba(0,0,0,.08), 0 8px 24px -12px rgba(0,0,0,.12);--glow:0 0 0 2px #18181B}
|
|
5
|
+
:is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds).dark, html.dark :is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds), :root[data-theme="dark"] :is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds){--chart-rest:#4A4F57;--raise:0 1px 2px rgba(0,0,0,.4);--lift:0 1px 3px rgba(0,0,0,.5), 0 8px 24px -12px rgba(0,0,0,.6);--glow:0 0 0 2px #FAFAFA}
|
|
6
6
|
:is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds){--chart-h-spark:32px;--chart-h-compact:120px;--chart-h-standard:180px;--chart-h-tall:240px;--chart-w-slide:1408px;--chart-w-page:642px;--chart-max-bars:12;--chart-max-series:3;--diagram-max-steps:6;--radius-mark:4px;--radius-step:16px;--radius-lane:10px}
|
|
7
7
|
:is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds) .pc *{box-sizing:border-box}
|
|
8
8
|
:is(.pm-ds,.pmd-ds,.pms-ds,.pmc-ds) .pc{margin:0;display:flex;flex-direction:column;gap:8px;font-family:var(--font-sans);color:var(--ink);min-width:0}
|
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
.cz .dlg, .cz .veil, .cz .toast, .cz .vmenu, .cz .crmenu, .cz .tbmenu, .cz .czi-tok, .cz .cz-vw { /* .cz-vw: the Home Viewer (cozy-viewer.js), whose views read the same tokens */
|
|
8
8
|
--sans: var(--cz-sans);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
--
|
|
12
|
-
--
|
|
9
|
+
/* text, surfaces and the accent read the page's --cz-* names, which ds-bridge.css points at the design system on a pm-ds page:
|
|
10
|
+
* one colour set for the page and its Viewer (initiative text-token-guard). They follow the theme by themselves. */
|
|
11
|
+
--ink: var(--cz-ink); --ink-2: var(--cz-ink2); --ink-3: var(--cz-ink3);
|
|
12
|
+
--card: var(--cz-card); --card-solid: var(--cz-card); --well: var(--cz-well); --hair: var(--cz-hair);
|
|
13
|
+
--ember: var(--cz-blue); --ember-ink: var(--cz-blueink); --solid: var(--cz-solid); --on-solid: var(--cz-onsolid); --spot: var(--cz-bluebg);
|
|
14
|
+
--ok: var(--cz-c-1e6b45); --bad: var(--cz-red); --warn: var(--cz-c-8a5a00); --warn-bg: var(--cz-c-fbf3e4); --ok-bg: var(--cz-c-e7f4ec); --live: var(--cz-c-9a3412); --live-bg: var(--cz-c-fdeee6);
|
|
13
15
|
--b3: rgba(42,46,53,.16);
|
|
14
16
|
--card-shadow: 0 1px 3px rgba(42,46,53,.08);
|
|
15
17
|
--glass: var(--cz-c-ffffff); --glass-edge: rgba(42,46,53,.08); --glass-shadow: 0 14px 34px -12px rgba(42,46,53,.35);
|
|
@@ -18,17 +20,15 @@
|
|
|
18
20
|
}
|
|
19
21
|
:root[data-theme="dark"] .cz .dlg, :root[data-theme="dark"] .cz .veil, :root[data-theme="dark"] .cz .toast, :root[data-theme="dark"] .cz .vmenu,
|
|
20
22
|
:root[data-theme="dark"] .cz .crmenu, :root[data-theme="dark"] .cz .tbmenu, :root[data-theme="dark"] .cz .czi-tok, :root[data-theme="dark"] .cz .cz-vw {
|
|
21
|
-
--ink: var(--cz-c-eceef1); --ink-2: var(--cz-c-c5c9d0); --ink-3: var(--cz-c-9ea4ad); --card: var(--cz-c-24262b); --card-solid: var(--cz-c-24262b); --well: var(--cz-c-1b1d21); --hair: rgba(236,238,241,.1);
|
|
22
|
-
--ember: var(--cz-c-6aaaf0); --ember-ink: var(--cz-c-9bc7f4); --solid: var(--cz-c-6aaaf0); --on-solid: var(--cz-c-17191c); --spot: rgba(106,170,240,.14);
|
|
23
23
|
--ok: var(--cz-c-7fc79a); --bad: var(--cz-c-f2948c); --warn: var(--cz-c-e8c27a); --warn-bg: rgba(212,161,58,.14); --ok-bg: rgba(94,156,106,.16); --live: var(--cz-c-f2a27a); --live-bg: rgba(217,119,63,.16);
|
|
24
|
+
--bad: var(--cz-red); /* the alert text follows the page (text-token-guard) */
|
|
24
25
|
--b3: rgba(236,238,241,.16); --glass: var(--cz-c-24262b); --glass-edge: rgba(236,238,241,.08); --card-shadow: 0 1px 3px rgba(0,0,0,.4);
|
|
25
26
|
}
|
|
26
27
|
@media (prefers-color-scheme: dark) {
|
|
27
28
|
:root:not([data-theme="light"]) .cz .dlg, :root:not([data-theme="light"]) .cz .veil, :root:not([data-theme="light"]) .cz .toast, :root:not([data-theme="light"]) .cz .vmenu,
|
|
28
29
|
:root:not([data-theme="light"]) .cz .crmenu, :root:not([data-theme="light"]) .cz .tbmenu, :root:not([data-theme="light"]) .cz .czi-tok, :root:not([data-theme="light"]) .cz .cz-vw {
|
|
29
|
-
--ink: var(--cz-c-eceef1); --ink-2: var(--cz-c-c5c9d0); --ink-3: var(--cz-c-9ea4ad); --card: var(--cz-c-24262b); --card-solid: var(--cz-c-24262b); --well: var(--cz-c-1b1d21); --hair: rgba(236,238,241,.1);
|
|
30
|
-
--ember: var(--cz-c-6aaaf0); --ember-ink: var(--cz-c-9bc7f4); --solid: var(--cz-c-6aaaf0); --on-solid: var(--cz-c-17191c); --spot: rgba(106,170,240,.14);
|
|
31
30
|
--ok: var(--cz-c-7fc79a); --bad: var(--cz-c-f2948c); --warn: var(--cz-c-e8c27a); --warn-bg: rgba(212,161,58,.14); --ok-bg: rgba(94,156,106,.16); --live: var(--cz-c-f2a27a); --live-bg: rgba(217,119,63,.16);
|
|
31
|
+
--bad: var(--cz-red); /* the alert text follows the page (text-token-guard) */
|
|
32
32
|
--b3: rgba(236,238,241,.16); --glass: var(--cz-c-24262b); --glass-edge: rgba(236,238,241,.08); --card-shadow: 0 1px 3px rgba(0,0,0,.4);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* documents.css: PMOS Documents, from the PMOS design system family, for the workspace. GENERATED from workspace/design-system/documents/ by
|
|
2
2
|
* lib/design-system.js: do not edit; change the system's files and run `node lib/design-system.js --write`. Every rule is scoped to .pmd-ds,
|
|
3
3
|
* so the sheet changes nothing until a page puts the class on its root. Load brand.css, then charts.css, then the system's own sheet. */
|
|
4
|
-
.pmd-ds{--raise:0 1px 2px rgba(
|
|
5
|
-
.pmd-ds.dark, html.dark .pmd-ds, :root[data-theme="dark"] .pmd-ds{--raise:0 1px 2px rgba(0,0,0,.4)
|
|
4
|
+
.pmd-ds{--raise:0 1px 2px rgba(0,0,0,.06);--lift:0 1px 3px rgba(0,0,0,.08), 0 8px 24px -12px rgba(0,0,0,.12);--glow:0 0 0 2px #18181B}
|
|
5
|
+
.pmd-ds.dark, html.dark .pmd-ds, :root[data-theme="dark"] .pmd-ds{--raise:0 1px 2px rgba(0,0,0,.4);--lift:0 1px 3px rgba(0,0,0,.5), 0 8px 24px -12px rgba(0,0,0,.6);--glow:0 0 0 2px #FAFAFA}
|
|
6
6
|
.pmd-ds{--doc-measure:640px;--doc-space-para:16px;--doc-space-block:24px;--doc-space-section:40px;--page-width:794px;--page-height:1123px;--page-margin-x:68px;--page-margin-top:76px;--page-margin-bottom:83px;--radius-sm:6px;--radius-md:10px;--radius-card:16px;--radius-pill:999px}
|
|
7
7
|
.pmd-ds{margin:0;background:var(--ground);color:var(--ink);font-family:var(--font-sans);font-size:16px;line-height:1.7}
|
|
8
8
|
.pmd-ds *{box-sizing:border-box}
|
|
@@ -18,6 +18,22 @@
|
|
|
18
18
|
--cz-sans: var(--font-sans); --cz-mono: var(--font-mono);
|
|
19
19
|
--cz-done: var(--blue); --cz-bubble: var(--blue-tint); --cz-solid: var(--blue); --cz-onsolid: var(--on-blue);
|
|
20
20
|
}
|
|
21
|
+
/* Dark: cozy.css's dark block (:root[data-theme="dark"] .cz) outranks the rule above on body.cz itself, so in Dark the shared modules on the
|
|
22
|
+
* body read cozy's own dark colours. Before 2026-11-25 those equalled the brand's; with the neutral set they differ (two blues in one sheet).
|
|
23
|
+
* The same names again, one step stronger, so Dark follows the system too (initiative text-token-guard). */
|
|
24
|
+
:root[data-theme="dark"] body.pm-ds, :root[data-theme="dark"] body.pm-ds .cz, :root[data-theme="dark"] body.pm-ds .pm-ds,
|
|
25
|
+
html.dark body.pm-ds, html.dark body.pm-ds .cz, html.dark body.pm-ds .pm-ds { /* a nested pm-ds (a Dark-theme island) resolves the names again */
|
|
26
|
+
--cz-ink: var(--ink); --cz-ink2: var(--ink); --cz-ink3: var(--muted);
|
|
27
|
+
--cz-card: var(--card); --cz-well: var(--well); --cz-well2: var(--well); --cz-hair: var(--line);
|
|
28
|
+
--cz-blue: var(--blue); --cz-blueink: var(--blue); --cz-bluebg: var(--blue-tint);
|
|
29
|
+
--cz-late: var(--alert); --cz-latebg: var(--alert-tint); --cz-risk: var(--alert); --cz-riskbg: var(--alert-tint);
|
|
30
|
+
--cz-red: var(--alert); --cz-redbg: var(--alert-tint); --cz-ok: var(--muted); --cz-okbg: var(--well);
|
|
31
|
+
--cz-dot-late: var(--alert); --cz-dot-risk: var(--alert); --cz-dot-red: var(--alert); --cz-dot-ok: var(--muted); --cz-dot-q: var(--line);
|
|
32
|
+
--cz-ground: var(--ground);
|
|
33
|
+
--cz-lift: var(--lift); --cz-float: var(--lift); --cz-sheet: var(--lift); --cz-vlift: var(--raise);
|
|
34
|
+
--cz-sans: var(--font-sans); --cz-mono: var(--font-mono);
|
|
35
|
+
--cz-done: var(--blue); --cz-bubble: var(--blue-tint); --cz-solid: var(--blue); --cz-onsolid: var(--on-blue);
|
|
36
|
+
}
|
|
21
37
|
:root body.pm-ds :focus-visible { outline: none; box-shadow: var(--glow); }
|
|
22
38
|
/* the ground follows the clock (pm/day-tint.js, bet A339): after the first paint, a change of part moves slowly */
|
|
23
39
|
:root[data-daytint-ease] body.pm-ds { transition: background-color var(--duration-light) var(--ease-drift); }
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* so the sheet changes nothing until a page puts the class on its root. Load brand.css, then charts.css, then the system's own sheet. */
|
|
4
4
|
/* Except the type, spacing and corner tokens (--type-, --leading-, --weight-, --space-, --radius-) and the workspace's older type names that
|
|
5
5
|
* point at them (--fs-*, --fw-*, --lh-*): those sit at :root, so a change to one Komorebi token reaches every page, with or without the class. */
|
|
6
|
-
.pm-ds{--raise:0 1px 2px rgba(
|
|
7
|
-
.pm-ds.dark, html.dark .pm-ds, :root[data-theme="dark"] .pm-ds{--raise:0 1px 2px rgba(0,0,0,.4)
|
|
6
|
+
.pm-ds{--raise:0 1px 2px rgba(0,0,0,.06);--lift:0 1px 3px rgba(0,0,0,.08), 0 8px 24px -12px rgba(0,0,0,.12);--glow:0 0 0 2px #18181B}
|
|
7
|
+
.pm-ds.dark, html.dark .pm-ds, :root[data-theme="dark"] .pm-ds{--raise:0 1px 2px rgba(0,0,0,.4);--lift:0 1px 3px rgba(0,0,0,.5), 0 8px 24px -12px rgba(0,0,0,.6);--glow:0 0 0 2px #FAFAFA}
|
|
8
8
|
:root{--space-4:4px;--space-8:8px;--space-12:12px;--space-16:16px;--space-24:24px;--space-32:32px;--space-48:48px;--space-64:64px;--doc-measure:640px;--page-measure:960px;--width-side:340px;--width-item:480px;--width-contents:200px;--width-margin:240px;--radius-sm:6px;--radius-md:10px;--radius-card:16px;--radius-panel:24px;--radius-pill:999px}
|
|
9
9
|
:root{--type-title:26px;--leading-title:32px;--weight-title:600;--type-heading:18px;--leading-heading:24px;--weight-heading:600;--type-body:15px;--leading-body:24px;--weight-body:400;--type-small:13px;--leading-small:20px;--weight-small:400;--type-code:13px;--leading-code:20px;--weight-code:400}
|
|
10
10
|
.pm-ds .title{font-family:var(--font-sans);font-size:var(--type-title);line-height:var(--leading-title);font-weight:var(--weight-title)}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* slides.css: PMOS Slides, from the PMOS design system family, for the workspace. GENERATED from workspace/design-system/slides/ by
|
|
2
2
|
* lib/design-system.js: do not edit; change the system's files and run `node lib/design-system.js --write`. Every rule is scoped to .pms-ds,
|
|
3
3
|
* so the sheet changes nothing until a page puts the class on its root. Load brand.css, then charts.css, then the system's own sheet. */
|
|
4
|
-
.pms-ds{--glow:0 0 0 2px #
|
|
5
|
-
.pms-ds.dark, html.dark .pms-ds, :root[data-theme="dark"] .pms-ds{--glow:0 0 0 2px #
|
|
4
|
+
.pms-ds{--glow:0 0 0 2px #18181B}
|
|
5
|
+
.pms-ds.dark, html.dark .pms-ds, :root[data-theme="dark"] .pms-ds{--glow:0 0 0 2px #FAFAFA}
|
|
6
6
|
.pms-ds{--slide-width:1920px;--slide-height:1080px;--slide-margin-x:112px;--slide-margin-top:96px;--slide-margin-bottom:128px;--slide-column:112px;--slide-gutter:32px;--slide-gap-16:16px;--slide-gap-24:24px;--slide-gap-48:48px;--slide-gap-64:64px;--slide-radius-mark:8px;--slide-radius-box:24px;--slide-radius-pill:999px}
|
|
7
7
|
.pms-ds{margin:0;background:var(--ground);color:var(--ink);font-family:var(--font-sans)}
|
|
8
8
|
.pms-ds *{box-sizing:border-box}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "text-token-guard (Wawan 2026-11-25): the neutral set is the one palette; `pmos design boards` checks and fixes canvas boards (colour tokens, literal colours, the type scale); `pmos design drift --block-text` fails a change that adds a text colour or size outside the system. Pure parts and one scratch git repository; no server, no network, no model.",
|
|
3
|
+
"modules": ["text-token-guard.test.js"],
|
|
4
|
+
"seconds": { "text-token-guard.test.js": 2 }
|
|
5
|
+
}
|