okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
4fb068a8c
main
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 ) => { 8const start = liquid . indexOf ( ` ${ selector } {` ); 9assert . ok ( start >= 0 , ` ${ selector } exists` ); 10return liquid . slice ( start , liquid . indexOf ( '}' , start )); 11}; 12 13test ( 'light New chat is the shared primary: tinted surface, green text, no near-black ink' , () => { 14const light = rule ( '.nav-new.st-btn--primary' ); 15assert . match ( light , / background:\s * var\(--st-accent-surface\) / ); 16assert . match ( light , / color:\s * var\(--st-accent-surface-ink\) / ); 17assert . ok ( ! /--st-accent-ink / . test ( light ), 'not the dark ink on a saturated fill' ); 18assert . 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' , () => { 22assert . match ( rule ( '.nav-new.st-btn--primary:hover:not(:disabled)' ), / var\(--st-accent-surface-hover\) / ); 23});