// @vitest-environment node import { describe, expect, it } from 'vitest'; import { JSDOM } from 'jsdom'; import { buildSrcdoc } from '../../src/runtime/srcdoc'; // Regression for nexu-io/open-design#1393. Some HTML files drive their // colors through `:root { --token: }` and `var(--token)` rather // than baking colors into element-level inline styles. The original // palette bridge only walked the DOM and read `getComputedStyle` for // `color` / `backgroundColor` / `borderColor`, which returns the // fallback / inherited value for nodes that paint via variables — so // `chromatic()` rejected those reads and the iframe stayed in its // original palette even though the host showed the new one as // selected. function extractPaletteScript(srcdoc: string): string { const match = srcdoc.match( /