Page MenuHomePhabricator

Set color/background to inherit or #333 on common templates/use of HTML4 bgcolor
Closed, ResolvedPublic2 Estimated Story Points

Description

NOTE: Template editors will be able to override this locally (For now using !important) and in future, we will provide a mechanism to disable these rules.

Problem: We have common templates spread across our wikis where colors have no semantic value in night mode. To limit the work that template editors have to do adopting night mode, we will ship styles that disable these colors.

Acceptance criteria

  • The rule for now will apply only to Minerva and live inside skins.minerva.base.styles/common/hacks.less
  • The rule will look like the following
html.skin-night-mode-clientpref-1 {
	.mw-parser-output {
		/* general case that templates/extensions can opt into*/ .skin-nightmode-reset-color,
		/* T357735 */ .quotebox.
		/* T357726 */.side-box, .side-box *,
		/* T358012 */ .navbox-even, .navbox-abovebelow, .navbox-title, .navbox-group
		 {
				:not(.notheme) { .night-mode-strip-all-colors-when-safe(); }
		}
		
		/* T358385 */ [bgcolor]
		 {
		  color: #333; /* Important: this should correspond with the light mode theme version of color-base */
		}
	}
}
@media ( prefers-color-scheme: dark ) {
  // copy of above
}

QA

This fixes various bugs. Please check these bugs and report back here.

QA Results - Beta

QA Results - Prod

Sign off steps

  • Make sure that a decision has been made around stability of classes created/utilized in this sprint such as .notheme, .skin-nightmode-reset-color (see Slack conversation). If no decision has been made create a new spike to discuss.

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

The plan is to attempt T358238 first and check in later whether we need to do this one instead based on how that is going.

Jdlrobson changed the task status from Stalled to Open.Feb 27 2024, 5:27 PM

(comment was on wrong ticket)

Jdlrobson renamed this task from Set color/background to inherit or #333 on common templates to Set color/background to inherit or #333 on common templates/use of HTML4 bgcolor.Feb 29 2024, 5:36 PM
Jdlrobson updated the task description. (Show Details)

Change 1007718 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/MinervaNeue@master] Set background/color to inherit for common templates

https://gerrit.wikimedia.org/r/1007718

bwang removed bwang as the assignee of this task.Feb 29 2024, 11:00 PM
bwang moved this task from Doing to Code Review on the Web-Team-Backlog (FY2023-24 Q3 Sprint 4) board.
bwang subscribed.

Please see 2 follow ups on the Gerrit patch (neither blocking but at minimum these should be talked about with the wider team)

Change 1007718 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Set background/color to inherit for common templates

https://gerrit.wikimedia.org/r/1007718

Per Patch Notes left by @Jdlrobson Followup work is:

1. CSS Class Name Standardisation:

  • Action: Initiate a discussion in the Slack channel to bikeshed the name of the skin-invert class. The goal is to settle on a name that accurately reflects its purpose while maintaining consistency with existing naming conventions.
  • Deliverable: A consensus on the new class name and a plan for its implementation across Wikimedia projects.

2. Enhancing Editors' Control Over Night Mode Styles:

  • Action: Consider the addition of a :not selector to the existing CSS to allow editors to opt-out specific elements from automatic night mode styling. This suggestion follows the pattern implemented for the main page, aiming to provide a consistent behaviour across all Wikimedia projects.
  • Example Implementation:
&:not(.notheme) {
  background: inherit !important;
  color: inherit !important;
}
  • Deliverable: A detailed proposal, including the technical implementation of the :not selector and examples of its usage. This proposal should be discussed with a broader group of stakeholders to ensure it meets the needs of editors and aligns with the overall design philosophy of Wikimedia projects.

References:

Next Steps:

  • Schedule a meeting or initiate a discussion thread in the relevant Slack channel to address the CSS class name standardisation.
  • Draft the proposal for enhancing editors' control over night mode styles and circulate it for feedback among the development team, design team, and selected editors for input.
  • Incorporate feedback and finalise the implementation plan.

Change 1008521 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/MinervaNeue@master] Make notheme exception to CSS hacks

https://gerrit.wikimedia.org/r/1008521

Change 1008521 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Make notheme exception to CSS hacks

https://gerrit.wikimedia.org/r/1008521

Change 1008475 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/MinervaNeue@master] Partial Revert "Set background/color to inherit for common templates"

https://gerrit.wikimedia.org/r/1008475

Change 1008476 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/MinervaNeue@wmf/1.42.0-wmf.21] Partial Revert "Set background/color to inherit for common templates"

https://gerrit.wikimedia.org/r/1008476

Change 1008475 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Partial Revert "Set background/color to inherit for common templates"

https://gerrit.wikimedia.org/r/1008475

I had to revert the patch as it was applying in light mode. I am trying to get this backported as that would cause a lot of unnecessary controversy if misunderstood. I've updated the description to explain how we want this to work.

  1. CSS Class Name Standardisation:

I've captured this as a sign off step.

  1. Enhancing Editors' Control Over Night Mode Styles:

This is now done. Support has been added for the .notheme class.

Jdlrobson updated the task description. (Show Details)

Change 1008476 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@wmf/1.42.0-wmf.21] Partial Revert "Set background/color to inherit for common templates"

https://gerrit.wikimedia.org/r/1008476

Mentioned in SAL (#wikimedia-operations) [2024-03-05T16:52:44Z] <brennen@deploy2002> Started scap: Backport for [[gerrit:1008476|Partial Revert "Set background/color to inherit for common templates" (T358164)]]

Mentioned in SAL (#wikimedia-operations) [2024-03-05T16:58:31Z] <brennen@deploy2002> jdlrobson and brennen: Backport for [[gerrit:1008476|Partial Revert "Set background/color to inherit for common templates" (T358164)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-03-05T17:16:26Z] <brennen@deploy2002> Finished scap: Backport for [[gerrit:1008476|Partial Revert "Set background/color to inherit for common templates" (T358164)]] (duration: 23m 42s)

Need to limit this to night mode, currently applied to day mode as well.

Change 1008935 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/MinervaNeue@master] Set background/color to inherit for common templates in dark mode

https://gerrit.wikimedia.org/r/1008935

Change 1008935 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Set background/color to inherit for common templates in dark mode

https://gerrit.wikimedia.org/r/1008935

Change 1008765 had a related patch set uploaded (by Jdlrobson; author: Bernard Wang):

[mediawiki/skins/MinervaNeue@wmf/1.42.0-wmf.21] Set background/color to inherit for common templates in dark mode

https://gerrit.wikimedia.org/r/1008765

Change 1008765 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@wmf/1.42.0-wmf.21] Set background/color to inherit for common templates in dark mode

https://gerrit.wikimedia.org/r/1008765

Mentioned in SAL (#wikimedia-operations) [2024-03-05T21:26:31Z] <urbanecm@deploy2002> Started scap: Backport for [[gerrit:1008765|Set background/color to inherit for common templates in dark mode (T358164)]], [[gerrit:1008472|HandleSectionLinks: Fix handling headings with raw > in attributes (T358810)]]

Mentioned in SAL (#wikimedia-operations) [2024-03-05T21:28:01Z] <urbanecm@deploy2002> matmarex and jdlrobson and urbanecm: Backport for [[gerrit:1008765|Set background/color to inherit for common templates in dark mode (T358164)]], [[gerrit:1008472|HandleSectionLinks: Fix handling headings with raw > in attributes (T358810)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-03-05T21:42:21Z] <urbanecm@deploy2002> Finished scap: Backport for [[gerrit:1008765|Set background/color to inherit for common templates in dark mode (T358164)]], [[gerrit:1008472|HandleSectionLinks: Fix handling headings with raw > in attributes (T358810)]] (duration: 15m 50s)

Edtadros updated the task description. (Show Details)
Edtadros subscribed.

I've commented the QA results on the individual tickets.

Thanks Edward. We'll track remaining work in new tickets.

Change 1009801 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/MinervaNeue@master] Expand the list of classes

https://gerrit.wikimedia.org/r/1009801

Change 1009801 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Expand the list of classes where colors are disabled in night mode

https://gerrit.wikimedia.org/r/1009801

MediaWiki code searches:

Found only in Skin:MinervaNeue repository… Thus, it's effective only on the Minerva skin?

Found only in Skin:MinervaNeue repository… Thus, it's effective only on the Minerva skin?

Currently we've scoped the initial release to Minerva skin. Night mode for Vector 2022 will be built over the next 4 weeks and these styles will then also apply to Vector 2022. This work will be done as part of T358071 and will also allow admins like yourself to disable those styles. Feel free to ask any questions on T358071 if anything in the task is unclear.