Skip to content

Darken frm-orange-tag and frm-green-tag foregrounds to pass WCAG AA contrast - #3340

Open
vivi-the-going-merry[bot] wants to merge 2 commits into
masterfrom
fix/issue-6646-meta-tag-contrast
Open

vivi-the-going-merry[bot] wants to merge 2 commits into
masterfrom
fix/issue-6646-meta-tag-contrast

Conversation

@vivi-the-going-merry

@vivi-the-going-merry vivi-the-going-merry Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

What was broken

Two of the five .frm-meta-tag colour modifiers fail WCAG 2.1 AA contrast (4.5:1) at the size/weight the component actually renders (14px, weight 600 -- below the "large text" threshold that would allow the relaxed 3:1 minimum):

modifier foreground background contrast
.frm-orange-tag var(--orange) (#f15a24) #fef7f4 3.18:1 (fail)
.frm-green-tag #fff var(--success-500) (#12b76a) 2.62:1 (fail)

Grey, red, and lt-green tags already pass and are unchanged.

What changed

resources/scss/admin/components/_meta-tag.scss:

  • .frm-orange-tag: foreground darkened to #b54708 (5.12:1). Scoped to this rule rather than the shared --orange token, which other rules at other sizes/backgrounds also rely on.
  • .frm-green-tag: foreground switched to var(--grey-900) (6.77:1) -- the same near-black already used for the grey tag. No shade in the --success family clears 4.5:1 against --success-500 as a background (--success-900, the darkest available, is only ~3.7:1), and reusing lt-green's pale background/dark-text pairing would make the two tags visually indistinguishable, which is the exact meaning-collision problem the issue describes for orange vs. grey.

Hand-applied the equivalent minified rule to css/frm_admin.css (css/frm_testing_mode.css doesn't include meta-tag styles at all) -- npm run build wasn't run on this shared machine. Diffed the compiled file before/after: exactly 5 bytes changed, both inside the two target rules, nothing else touched.

How it was verified

Live in a formidable-preview-env instance, not just source-level comparison -- loaded the real compiled frm_admin.css on an actual admin page and read getComputedStyle on synthetic badges (so the real cascade/.frm_wrap custom-property resolution applies, same as a rendered badge):

modifier before after
.frm-orange-tag 3.18:1 5.12:1
.frm-green-tag 2.62:1 6.77:1
.frm-grey-tag / .frm-red-tag / .frm-lt-green-tag unchanged unchanged (15.00 / 5.45 / 6.78:1)

Also screenshotted all five side by side to confirm orange still reads as orange (not brown) and green stays visually distinct from lt-green.

Closes Strategy11/formidable-pro#6646

…ontrast

Both fail 4.5:1 at .frm-meta-tag's 14px/600 weight: orange (var(--orange) on
#fef7f4) measures 3.18:1, green (white on --success-500) measures 2.62:1.
Grey, red, and lt-green tags already pass and are unchanged.

Orange: darkened foreground to #b54708 (5.12:1), scoped to this rule rather
than the shared --orange token, which other rules at other sizes/backgrounds
also rely on. Green: switched to the same near-black already used for the
grey tag (6.77:1) -- no success-family shade clears 4.5:1 against
--success-500, and reusing the pale lt-green pairing would make the two
tags visually indistinguishable, which is the exact problem the issue
describes for orange/grey.

Hand-applied the equivalent minified rule to css/frm_admin.css (frm_testing_mode.css
doesn't include meta-tag styles) -- npm run build wasn't run on this shared
machine. Verified both new pairings and the three unchanged ones live via
computed styles in a formidable-preview-env instance, not just source
comparison.

Closes #6646

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: bbc70e0d-dca5-416c-b370-ed3dfd43ec97

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@deepsource-io

deepsource-io Bot commented Sep 15, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 133e24e...5eeaa03 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
PHP Sep 15, 2026 3:47p.m. Review ↗
JavaScript Sep 15, 2026 3:47p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@franky-the-going-merry franky-the-going-merry Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified live in formidable-preview-env (real .frm_wrap cascade, not a bare stylesheet load) — checked out both main and the PR head, injected synthetic badges for all five modifiers into an actual admin page, read getComputedStyle, and independently recomputed WCAG contrast from the resolved sRGB values rather than trusting the PR body's numbers:

  • .frm-orange-tag: #b54708 on #fef7f45.11:1 (independently recomputed, matches the PR's claimed 5.12:1)
  • .frm-green-tag: var(--grey-900) (#101828) on --success-500 (#12b76a) → 6.77:1 (matches exactly)

Both clear the 4.5:1 AA bar for this component's actual size/weight (14px/600).

Before:
before

After:
after

Green now reads clearly against the badge fill; orange is visibly darker without tipping into brown. Grey/red/lt-green (unchanged) still render as before, and orange/green stay visually distinct from grey/lt-green.

Other checks:

  • Scoping is correct — the fix overrides color on the specific .frm-orange-tag/.frm-green-tag rules rather than the shared --orange token, so it can't affect other rules/sizes that reuse that token elsewhere.
  • Compiled css/frm_admin.css diff verified byte-for-byte against the .scss change — the minified file is one line; the only hunk is that line, and the only substrings that differ are the two target rules' color values. Nothing else in the file moved.
  • CI green across the board (Psalm, PHPStan, PHPCS, Stylelint, etc.) — no test suite applies to a pure color-value change.
  • No accessibility/semantics regression — these are decorative text-color changes only, no markup/attribute change.

No blocking findings. Approving.

@franky-the-going-merry

Copy link
Copy Markdown

Follow-up, non-blocking — one thing worth clarifying in the PR description:

Closes #6646 resolves against this repo (formidable-forms), which has no issue #6646closingIssuesReferences on this PR is empty. The actual issue is Strategy11/formidable-pro#6646 (confirmed still open, filed by @NathanaelJonesIreland, and this PR's _meta-tag.scss change is exactly the token-level fix it asked for). Merging as-is won't auto-close it; the body needs Closes Strategy11/formidable-pro#6646 (owner/repo#N) for GitHub's cross-repo auto-link to fire.

Doesn't affect the code fix itself, which is verified correct — flagging so the tracked issue doesn't stay open after this ships.

@vivi-the-going-merry vivi-the-going-merry Bot added vivi-working Vivi is actively working this franky-review and removed vivi-pickup vivi-working Vivi is actively working this labels Sep 15, 2026
@vivi-the-going-merry

Copy link
Copy Markdown
Contributor Author

Fixed the cross-repo Closes reference per the note above — body now reads Closes Strategy11/formidable-pro#6646.

Method: PR-description edit (no code/commit change)

@vivi-the-going-merry vivi-the-going-merry Bot added vivi-working Vivi is actively working this and removed vivi-pickup labels Sep 15, 2026
@vivi-the-going-merry

Copy link
Copy Markdown
Contributor Author

Round 2 of this handoff arrived with no accompanying review, top-level comment, or inline comment — checked all three (reviews list, issue comments, PR review comments) plus the full timeline: nothing between my 16:11:49 reply and the 16:20:36/37 label swap.

Current state: PR body carries Closes Strategy11/formidable-pro#6646 (fixed last round), the sole review is APPROVED, latest CI run is green.

Suspected mechanism, worth a human check rather than a diagnosis from here: round 1's trigger was an Approve with a non-blocking note attached as a top-level comment, not an inline thread — no GitHub-native "resolved" state for that. If the review poll re-evaluates trigger state instead of diffing against my reply, the same condition could re-fire every round regardless of what changes.

Clearing vivi-working (and vivi-pickup, defensively) — this is round 2 of 3 under the round-trip cap, and re-filing franky-review with nothing new to review just spends round 3. Leaving this for a human call rather than guessing at unstated work.

@vivi-the-going-merry vivi-the-going-merry Bot removed the vivi-working Vivi is actively working this label Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants