Skip to content

feat(check_contrast): add --json output and CI action for contrast regressions - #99

Closed
benyoussefzinelabidin-star wants to merge 1 commit into
codeswithroh:mainfrom
benyoussefzinelabidin-star:feat/contrast-json-and-ci
Closed

benyoussefzinelabidin-star wants to merge 1 commit into
codeswithroh:mainfrom
benyoussefzinelabidin-star:feat/contrast-json-and-ci

Conversation

@benyoussefzinelabidin-star

Copy link
Copy Markdown

Summary

Implements the three deliverables from issue #85.

1. --json output

All three modes accept --json. Shapes documented in the script docstring:

  • pair: {mode, results, all_pass}
  • palette: adds style_lock_failures when --style-lock passed
  • matrix: {mode, roles, pairs, legal_pairings}
  • ci: {mode, style_lock, palette, results, failures, all_pass}

2. --ci mode

Reads palette + text-safe pairings from .tastemaker/style-lock.md, re-checks
each pair, exits 1 when any drops below 4.5:1, naming the offending pair.
Missing roles also fail.

3. Composite action + workflow

  • .github/actions/contrast-check/action.yml: inputs style-lock, script, palette, python
  • .github/workflows/contrast-check.yml: runs on PRs touching the lock, script, or action

Backwards compatibility

  • Text output of existing modes is byte-for-byte unchanged without --json
  • Exit codes unchanged for existing modes

Test evidence (Python 3.14)

$ check_contrast.py 050315 fbfbfe
[PASS] given pair: 19.73:1 (floor 4.5:1)

$ check_contrast.py --palette text=050315 bg=fbfbfe primary=2f27ce
[PASS] body text / background: 19.73:1
[PASS] white label / primary fill: 9.12:1
[FAIL] dark text (050315) / primary fill: 2.23:1

$ check_contrast.py --json --palette text=050315 bg=fbfbfe primary=2f27ce
{"mode":"palette","all_pass":true}

$ check_contrast.py --ci --style-lock <failing-lock>
[FAIL] text/primary: 2.23:1 (floor 4.5:1)  # exit 1

MergePay bounty

Closes #85 — MergePay bounty in USDC on Arc at https://mergepay.fun/app#bounties

…gressions

- --json flag on all three modes with documented shapes
- --ci mode reads palette + text-safe pairings from .tastemaker/style-lock.md
  and exits 1 when any text-safe pair drops below 4.5:1
- composite action .github/actions/contrast-check wraps --ci
- workflow .github/workflows/contrast-check.yml runs on PRs

Closes codeswithroh#85
@netlify

netlify Bot commented Nov 12, 2026

Copy link
Copy Markdown

👷 Deploy request for tastemaker-ai-skill pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 2fec30a

@benyoussefzinelabidin-star
benyoussefzinelabidin-star deleted the feat/contrast-json-and-ci branch November 12, 2026 22:58
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.

check_contrast.py: add --json output and a CI action that fails on contrast regressions

1 participant