In T358240 we decided to use a CSS rule to make sure a color is always defined for templates. We deemed this would be less risky than a PHP based solution T358239 with no negative impact on performance.
The rule proposed would look like this and would only apply to night mode:
.mw-parser-output [style*="background"]{ color: #333; }
Steps to reproduce
- Visit https://en.m.wikipedia.beta.wmflabs.org/wiki/T35879?minervanightmode=1 or https://en.m.wikipedia.org/w/index.php?title=User:Jdlrobson/sandbox&oldid=1211134141&minervanightmode=1
Expected results
Example 1: Black text on yellow background.
Example 2: Purple text on yellow background.
Actual results
White text on yellow background.
Environments observed
- Browser version:
- OS version:
- Device model:
- Device language:
Check any additional observations
- Observed on the beta cluster wiki
- Observed on a production wiki
- Observed on Vector desktop skin
- Observed on MinervaNeue responsive skin
- Observed while logged in
- Observed while not logged in (anonymous)
Developer checklist
- Make sure the new rule only applies to automatic and day mode
- The rule should not be !important, any inline styles which are defined should overwrite it
- The rule should apply to background: yellow, background:yellow; and background-color: yellow
- Make sure to include an ADR for this decision. Link to https://phabricator.wikimedia.org/T358240#9591458 in the decision record so outsiders understand why we did this.
Additional QA
The scope of this rule is pretty large so might cause some issues. We'll want to do lots of exploratory testing to understand this more.
In production
- "Queen of the Ptolemaic Kingdom" in infobox on https://en.m.wikipedia.org/wiki/Cleopatra?minervanightmode=1
- "Screenshot" in infobox on https://en.m.wikipedia.org/wiki/Facebook?minervanightmode=1
- Infobox on https://dag.m.wikipedia.org/wiki/Paris?minervanightmode=1
- Infobox on https://da.m.wikipedia.org/wiki/Paris?minervanightmode=1
QA Results - Beta
AC | Status | Details |
---|---|---|
1 | ✅ | T358797#9643947 |
2 | ✅ | T358797#9643947 |
QA Results - Prod
AC | Status | Details |
---|---|---|
1 | ✅ | T358797#9643981 |
2 | ❓ | T358797#9643981 |