Files
hyperframes/packages
Miguel Ángel ad925cb8fe feat(cli): integrate contrast audit into hyperframes validate --contrast
Adds --contrast flag to the validate command. When enabled, after the
standard console-error check, the command:

1. Reads composition duration from window.__hf or data-duration attribute
2. Seeks to 5 evenly-spaced timestamps via the runtime seek protocol
3. Takes a screenshot at each timestamp
4. Injects a browser-side audit script that walks the DOM for text elements,
   samples background pixels via canvas from the screenshot, and computes
   WCAG 2.1 contrast ratios
5. Reports failures as CLI errors with selector, text, ratio, and timestamp

Zero new Node dependencies — all pixel work runs in the browser via
canvas getImageData. The WCAG math is injected as a raw script string
to avoid esbuild transform issues with page.evaluate.

Usage:
  hyperframes validate --contrast
  hyperframes validate --contrast --json

Contrast failures exit with code 1, same as console errors.
2026-04-14 18:18:28 +02:00
..
2026-04-14 01:16:06 +02:00
2026-04-14 01:16:06 +02:00