Forums Bug Reports Thread

White and Gold user-flair colors render invisible/low-contrast on light theme

Patrick Bass · Jun 6 · 13 · 1 Locked
[Major] [High Priority] [Bug Fixed] [Always Reproduces]
🚀 OP Jun 6, 2026 5:27pm

Area: Forums (audit p2) · Surface: User flair next to usernames (templates/forums/_thread-rows.php, thread.php, _action-bar.php) · Dimension: Law 3 — contrast in every theme · Severity: major

Members can choose White (#ffffff) or Gold (#ffcc00) flair, accepted by the server. Flair text uses the raw color directly with a same-colored border. On light theme the card background is #ffffff, so White flair is completely invisible and Gold is unreadable. The same color is used in both themes with no contrast guard.

Evidence

Allowed flair palette (server-validated) includes White and Gold:
ForumController.php:4677: $allowedColors = ['#2C7CFF', '#ff6600', '#3399ff', '#ff3366', '#ffcc00', '#cc66ff', '#ffffff', '#20c820'];
Flair is rendered with the raw color as TEXT color:
_thread-rows.php:148: <span class="user-flair" style="color:<?= $e($userFlairs[...]['flair_color'] ?? '#2C7CFF') ?>">
thread.php:971 / :980 use the same pattern. The flair css adds a same-color border: style.css:7896-7899 .user-flair{...border:1px solid currentColor;opacity:0.9}.
Light theme card background is white: style.css:9945 [data-theme="light"]{ --color-bg-card: #ffffff; }.
Result: a White flair (#ffffff) = white text + white border on a white card = invisible in light theme; Gold (#ffcc00) is similarly low-contrast on white. No per-theme adjustment is applied to flair color.

Suggested fix. Either drop White/Gold from the palette, or apply the flair color as a background chip (with computed contrasting text) instead of as raw text color, or clamp flair luminance against the active theme's surface. At minimum, swap the same-color border for a neutral --color-border so the chip outline is always visible.

Filed by the automated tenant-app audit and adversarially evidence-verified. Status: verified. Open — not yet actioned.


Patrick Bass
@mobieus

🚀 Jun 7, 2026 4:59am

Resolved — fixed and deployed. Commit faa14fc59739, shipped dev-first then to all tenants on 2026-06-06.

User flair (line 148) applied the flair_color as text color, so White/Gold flairs were unreadable against the light background. Now renders the flair color as a background chip and computes a contrasting text color (#1a1a1a or #ffffff) from the chip's luminance, with a safe fallback to #2C7CFF for malformed hex values.

Status: fixed. Thread closed and locked.


Patrick Bass
@mobieus

Log in or register to reply to this thread.