Skip to content

fix(cli): account for text strokes in contrast checks#2349

Open
miguel-heygen wants to merge 2 commits into
mainfrom
fix/contrast-text-stroke
Open

fix(cli): account for text strokes in contrast checks#2349
miguel-heygen wants to merge 2 commits into
mainfrom
fix/contrast-text-stroke

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

Summary

  • recognize solid -webkit-text-stroke paint during browser contrast audits
  • hide and restore stroke paint while sampling the true background
  • use the stronger fill-or-stroke contrast result for outlined captions
  • keep the HyperFrames creative contrast-report helper in sync
  • add browser regression coverage for white text with an 8px black outline

Verification

  • bun run --cwd packages/cli test --run src/commands/layout-audit.browser.test.ts (39 tests passed)
  • bunx oxfmt --check packages/cli/src/commands/contrast-audit.browser.js packages/cli/src/commands/layout-audit.browser.test.ts skills/hyperframes-creative/scripts/contrast-report.mjs
  • node --check skills/hyperframes-creative/scripts/contrast-report.mjs
  • git diff --check

The package typecheck was attempted, but a fresh worktree lacks generated packages/core/src/generated/runtime-inline modules; CI generates these before the full typecheck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant