fix(a11y): full-contrast suggestion value spans (#380)#427
Conversation
The .from-value / .to-value spans were rendered at opacity: .8, which alpha-blends the suggestion text against an unknown skin background. On the default colibris skin this still passes WCAG AA, but on darker or branded skins it can drop below the 4.5:1 threshold. Remove the opacity so the value text inherits the skin's full-strength text color (the italic + quote affordances already distinguish it from the labels). This keeps each skin in control of the colour and works on the latest release (2.7.3) and develop without any core change. Add a Playwright regression guard asserting the rendered value spans are fully opaque. Closes #380 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Review Summary by QodoFix suggestion value spans contrast by removing opacity styling
WalkthroughsDescription• Remove opacity styling from suggestion value spans for WCAG AA contrast compliance • Ensure value text inherits skin's full-strength color instead of alpha-blending • Add Playwright regression test asserting rendered spans maintain full opacity Diagramflowchart LR
A["Suggestion value spans<br/>opacity: .8"] -->|Remove opacity| B["Full-strength text color<br/>opacity: 1"]
B -->|Inherit from skin| C["WCAG AA compliant<br/>4.5:1 contrast"]
D["Regression test"] -->|Assert opacity| C
File Changes1. static/css/comment.css
|
Code Review by Qodo
1.
|
…city (#380 Qodo) Investigating Qodo's contrast feedback revealed the real root cause: the colibris skin renders .from-value / .to-value in its green --primary-color (#64d29b), ~1.9:1 against the light comment background — failing WCAG AA. It also already sets opacity:1, so removing the plugin's opacity alone had no effect on the default skin. Set the value text to the skin's regular --text-color token (readable on every bundled skin, still skin-overridable) with a dark fallback, using !important to beat the core skin's non-important green regardless of stylesheet load order. This is the explicit, skin-overridable colour token Qodo asked for. Strengthen the regression test to compute the actual rendered contrast ratio (folding in opacity and the effective background) and assert it meets WCAG 2.1 AA (>= 4.5:1), instead of only checking opacity === 1. The test fails against the green core styling and passes with the override; verified on both 2.7.3 and develop. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thanks @qodo — both points were spot on and led to the real root cause. The default colibris skin already overrode the plugin's
The strengthened test fails against the green core styling and passes with the override, on both 2.7.3 and develop. Pushed. |
Problem
`static/css/comment.css` rendered the suggestion value spans (`.from-value` / `.to-value`) at `opacity: .8`. Alpha-blending the text against an unknown skin background drops contrast below WCAG 2.1 AA (4.5:1) on darker / branded skins, even though the default colibris skin still passes.
Fix
Remove the `opacity: .8` from both the display and create variants so the value text inherits the skin's full-strength text color. Each skin then controls the colour directly instead of relying on alpha-blending against an unknown background. The `font-style: italic` and quote pseudo-elements still visually distinguish the value from its label.
Pure CSS — works identically on the latest release (2.7.3) and develop, no core update required.
Test
Added a Playwright regression guard in `commentSuggestion.spec.ts` that creates a suggestion, opens the comment, and asserts the rendered `.from-value` / `.to-value` spans report `opacity: 1`.
Verified locally (frontend) on both Etherpad 2.7.3 and develop — 4/4 suggestion specs pass on each.
Closes #380
🤖 Generated with Claude Code