Fix: dark-theme contrast for tw-style badges in billboard content (#22942)#23204
Open
Auguzcht wants to merge 1 commit intoforem:mainfrom
Open
Fix: dark-theme contrast for tw-style badges in billboard content (#22942)#23204Auguzcht wants to merge 1 commit intoforem:mainfrom
Auguzcht wants to merge 1 commit intoforem:mainfrom
Conversation
Contributor
|
Thank you for opening this PR! We appreciate you! For all pull requests coming from third-party forks we will need to A Forem Team member will review this contribution and get back to |
Contributor
There was a problem hiding this comment.
Pull request overview
Improves dark-mode contrast for “badge/pill” elements authored via admin markdown/HTML (with tw-* utility classes) when rendered inside billboard/page content.
Changes:
- Adds a CSS “guardrail” rule to restyle certain
tw-*badge-like elements using Forem pill design tokens. - Ensures badge text/border/background remain theme-appropriate (notably in dark mode).
3d71875 to
06e5bd9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this? (check all applicable)
Description
This PR improves dark-mode accessibility contrast for learning track level badges (e.g. "Beginner", "Intermediate") rendered inside billboard/page content.
During investigation, I traced the rendering path and confirmed that the low-contrast badge styling is not coming from a hardcoded component within the repository, but rather from admin-authored markdown/HTML content injected through Forem’s billboard/page rendering pipeline.
Relevant rendering paths:
app/models/billboard.rb → app/views/shared/_billboard.html.erbapp/models/page.rb → app/views/pages/show.en.html.erbThe problematic styling originates from
tw-*utility-style classes embedded in rendered content (likely authored externally or via admin tooling), which can result in insufficient contrast when rendered inside dark-themed card surfaces.Approach
Instead of modifying or relying on DB/content changes, this PR introduces a scoped CSS guardrail that ensures badge-like elements inside rendered billboard content remain accessible across themes.
The fix applies semantic pill-like styling using Forem’s design tokens (
--pill-bg,--pill-color,--pill-border) to enforce consistent contrast in dark mode.Key Design Decision
Trade-offs considered
Related Tickets & Documents
QA Instructions, Screenshots, Recordings
How to test
Devices tested
UI accessibility checklist
Added/updated tests?
Why: This is a styling-level accessibility guardrail applied at the presentation layer; existing visual regression coverage and manual QA are sufficient for this scope.
[optional] Post deployment tasks
None required.
[optional] What gif best describes this PR or how it makes you feel?