okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221rc1 merge ds-coder (d6a5a7837)4fb068a8c

main
1.0 KiB23 linesraw
1import test from 'node:test';
2import assert from 'node:assert/strict';
3import {readFileSync} from 'node:fs';
4import {resolve} from 'node:path';
5
6const liquid = readFileSync(resolve(import.meta.dirname, '..', 'src/styles/liquid.css'), 'utf8');
7const rule = (selector) => {
8  const start = liquid.indexOf(`${selector} {`);
9  assert.ok(start >= 0, `${selector} exists`);
10  return liquid.slice(start, liquid.indexOf('}', start));
11};
12
13test('light New chat is the shared primary: tinted surface, green text, no near-black ink', () => {
14  const light = rule('.nav-new.st-btn--primary');
15  assert.match(light, /background:\s*var\(--st-accent-surface\)/);
16  assert.match(light, /color:\s*var\(--st-accent-surface-ink\)/);
17  assert.ok(!/--st-accent-ink/.test(light), 'not the dark ink on a saturated fill');
18  assert.ok(!/background:\s*var\(--st-accent\)\s*;/.test(light), 'no full-strength #10b981 fill');
19});
20
21test('its hover also uses the shared primary token', () => {
22  assert.match(rule('.nav-new.st-btn--primary:hover:not(:disabled)'), /var\(--st-accent-surface-hover\)/);
23});