Page MenuHomePhabricator

Use of darkmode-custom-fix should be discouraged
Closed, ResolvedPublic

Description

Background

One of the big successes of dark mode was that it drove a lot of Codex design token adoption as interfaces that used custom colors broke in dark mode. In a few select cases we worked around this with the expectation that over time we would replace those custom colors with dark mode.

Back in December we introduced a public mixin called darkmode-custom-fix which is currently only used by DiscussionTools.

We'd like to discourage its use as this could move us towards a pattern that's harder to maintain on the long-term (for example: deprecating mixins has been very difficult historically) and we should not be encouraging extension developers to favor "custom dark fixes" over evolving with the Codex design system.

User story

As a developer I want to be guided about the best way to integrate dark mode for my extension/skin.

Requirements

  • Dark mode best practices are documented on mediawiki.org
  • Use of the mixin should trigger a stylelint warning. https://github.com/wikimedia/stylelint-config-wikimedia/pull/256 which links to the above best pratices
  • The mixin is named before it sees further adoption
  • DiscussionTools is patched to use the new name
  • Upgrade to v0.19.2 of stylelint-config-wikimedia
  • As a best practice it should error if used in core. We shouldn't add any new instances to core.

BDD

  • For QA engineer to fill out

Test Steps

  • For QA engineer to fill out

Design

  • Add mockups and design requirements

Acceptance criteria

  • Add acceptance criteria

Communication criteria - does this need an announcement or discussion?

  • Add communication criteria

Rollback plan

  • What is the rollback plan in production for this task if something goes wrong?

This task was created by Version 1.2.0 of the Web team task template using phabulous

Event Timeline

Jdlrobson-WMF renamed this task from Web Task Creation Form to Use of darkmode-custom-fix should be discouraged.Feb 13 2026, 10:08 PM

@AnneT suggested making it clear it is an override would be sensible and @matmarex pointed out if we want to rename we should do it now. Would darkmode-override make sense? Any other options?

Jdlrobson-WMF updated the task description. (Show Details)

darkmode-override makes sense to me

Change #1240812 had a related patch set uploaded (by Anne Tomasevich; author: Anne Tomasevich):

[mediawiki/core@master] Change `.darkmode-custom-fix` mixin to `.darkmode-override`

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

Change #1240813 had a related patch set uploaded (by Anne Tomasevich; author: Anne Tomasevich):

[mediawiki/extensions/DiscussionTools@master] Change `.darkmode-custom-fix` mixin to `.darkmode-override`

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

Change #1240812 merged by jenkins-bot:

[mediawiki/core@master] Change `.darkmode-custom-fix` mixin to `.darkmode-override`

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

Change #1240813 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Change `.darkmode-custom-fix` mixin to `.darkmode-override`

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

I think this just needs the stylelint-config-wikimedia update in core before we call this resolved?

Change #1276810 had a related patch set uploaded (by VolkerE; author: VolkerE):

[mediawiki/core@master] build: Upgrade stylelint-config-wikimedia to 0.19.2

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

Change #1276810 merged by jenkins-bot:

[mediawiki/core@master] build: Upgrade stylelint-config-wikimedia to 0.19.2

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

Change #1279305 had a related patch set uploaded (by Atieno; author: VolkerE):

[mediawiki/core@REL1_46] build: Upgrade stylelint-config-wikimedia to 0.19.2

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

Change #1279305 abandoned by Atieno:

[mediawiki/core@REL1_46] build: Upgrade stylelint-config-wikimedia to 0.19.2

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

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

[mediawiki/core@master] Use of darkmode-custom-fix should error

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

We are triggering a warning, but on core, warnings don't block (and I think it's important they do)
I'm a bit rusty on stylelint configuration. Does anyone know why https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1279479 doesn't work?

Change #1279479 merged by jenkins-bot:

[mediawiki/core@master] styles: Use of `darkmode-custom-fix()` Less mixin should result in error

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

matmarex removed a project: Patch-For-Review.
matmarex updated the task description. (Show Details)