Forums Bug Reports Thread

Forum brand-color preview hardcodes white text, becomes invisible when a light brand color is chosen

Patrick Bass · Jun 6 · 16 · 1 Locked
[Minor] [Normal Priority] [Bug Fixed] [Always Reproduces]
🚀 OP Jun 6, 2026 8:51pm

Area: Forums (re-run) (audit p2r) · Surface: /forums/{slug}/settings — branding tab (ForumSettingsController@show) · Dimension: Law 3 — contrast · Severity: minor

The branding tab shows a live preview chip and button that always use white text over the moderator-chosen brand color. The color picker has no lightness guard, so choosing a light brand color makes the preview text invisible — which is exactly the surface meant to show the moderator what their choice will look like.

Evidence

platform/templates/forums/settings.php:416 `.fs-brand-chip{...color:#fff;...background:var(--_fs-brand,#5f86ff)}` and :417 `.fs-brand-button{...color:#fff;...background:var(--_fs-brand,#5f86ff);...}`. `--_fs-brand` is set live from a free `input[type=color]` value with no lightness constraint (settings.php:521-527, `paint()` does `el.style.setProperty('--_fs-brand', c)`). Picking white/gold/light-gray as the forum brand color yields white text on a light fill.

Suggested fix. Compute a contrasting foreground for the preview (e.g. pick black or white based on the brand color's luminance in the paint() handler) instead of hardcoding white, or constrain the color input to colors with sufficient contrast against white.

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


Patrick Bass
@mobieus

🚀 Jun 7, 2026 5:49am

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

Branding preview no longer hardcodes white text on the brand color. Added a contrastFg() helper in paint() that computes black (#0a0d12) or white (#fff) from the brand color's WCAG relative luminance, sets it via a new --_fs-brand-fg CSS var on the chip/button/bar, and the .fs-brand-chip/.fs-brand-button CSS now reads color:var(--_fs-brand-fg,#fff) so light brand colors stay legible.

Status: fixed. Thread closed and locked.


Patrick Bass
@mobieus

Log in or register to reply to this thread.