Page MenuHomePhabricator

Regression: DismissableSiteNotice "dismiss" link-button is the wrong color
Closed, ResolvedPublicBUG REPORT

Authored By
Msz2001
Nov 2 2024, 9:54 AM
Referenced Files
F62305111: screenshot 42.png
Jun 12 2025, 6:07 PM
F62305110: screenshot 43.png
Jun 12 2025, 6:07 PM
F61665717: image.png
Jun 5 2025, 3:29 PM
F61665690: image.png
Jun 5 2025, 3:29 PM
F61665793: image.png
Jun 5 2025, 3:29 PM
F61665774: image.png
Jun 5 2025, 3:29 PM
F57666210: image.png
Nov 2 2024, 9:54 AM

Description

Steps to replicate the issue (include links if applicable):

What happens?:
The link foreground is #0645ad (the pre-July 2022 color for links).

What should have happened instead?:
The link should be of color color-progressive (i.e. adaptive to dark mode, #36c or #88a3e8, depending on the theme).

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):
This is a regression after T373989: Link-based buttons get a border radius even when unwanted (update Vector's anchor selector to match Minerva's)

image.png (358×438 px, 18 KB)

Requirement

The "dismiss" link in DismissableSiteNotice should follow the current color-progressive token for proper theming across light and dark modes.

BDD

Feature: Adaptive link color in DismissableSiteNotice

Scenario: Dismiss link uses old link color
  Given I visit https://test.wikipedia.org/wiki/Main_Page
  When I view the dismissable site notice
  Then the "dismiss" link should have the color defined by `color-progressive` and adapt to the current theme

Test Steps

Test Case 1: Dismiss link uses adaptive color

  1. Visit https://test.wikipedia.org/wiki/Main_Page
  2. Observe the "dismiss" link in the DismissableSiteNotice
  3. Switch between light and dark mode
  4. AC1: The dismiss link should use color-progressive and adapt accordingly (e.g. #36c in light mode, #88a3e8 in dark mode)

QA Results - Prod

ACStatusDetails
1✅T378872#10910605

Event Timeline

Apart from overriding the color in the extension's CSS (which I could provide a patch for), is there a better solution for this? This is the same problem as T381316, both are anchor elements with the button role and thereby excluded from the selector that applies the correct color

Apart from overriding the color in the extension's CSS (which I could provide a patch for), is there a better solution for this? This is the same problem as T381316, both are anchor elements with the button role and thereby excluded from the selector that applies the correct color

I believe the root cause for this is that #0645ad is the MediaWiki default value for LESS variable @color-link (mediawiki.skin.defaults.less#39). I'm not sure whether this is a desired behavior, as Vector Legacy styles already overrides this variable (and related ones) to have their value from before 2022 (vector/mediawiki.skin.variables.less#29) – but it has no effect there, as the overriden values are the same as the new ones. On the other hand, new Vector does not specify value for this variable, it relies instead solely on @color-progressive from Codex (link.less#34).

The Vector 2022 approach worked fine as long as the @color-progressive was applied to all the links (before T373989), but when its scope was reduced to only non-button links, the default MediaWiki rule manifested itself.

I believe the mose future-proof solution would be to set @color-link: @color-progressive in Vector 2022's mediawiki.skin.variables.less, as it would apply to all the links without the (unwanted) burden of other Codex styles whose scope was reduced in T373989.

Changing the MediaWiki default link colors could also be an option but it would tie the core to the Vector's approach for dark and light mode, which I'm not sure if is desired.

This "button" is responsible for a lot of color contrast errors in https://github.com/wikimedia/color-contrast-checker for desktop – every desktop page has one.
@Jdlrobson-WMF

Change #1154052 had a related patch set uploaded (by SomeRandomDeveloper; author: SomeRandomDeveloper):

[mediawiki/extensions/DismissableSiteNotice@master] Fix "dismiss" link-button color

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

SomeRandomDeveloper changed the task status from Open to In Progress.Jun 5 2025, 3:29 PM

Change #1154052 merged by jenkins-bot:

[mediawiki/extensions/DismissableSiteNotice@master] Fix "dismiss" link-button color

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

Jdlrobson-WMF added a project: Web-Team.

Fix will roll out next week with the train. Thanks!

Edtadros subscribed.

Test Result - Prod

Status: ✅ PASS
Environment: testwiki
OS: macOS Sequoia 15.5
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: NA

Test Steps

Test Case 1: Dismiss link uses adaptive color

  1. Visit https://test.wikipedia.org/wiki/Main_Page
  2. Observe the "dismiss" link in the DismissableSiteNotice
  3. Switch between light and dark mode
  4. ✅ AC1: The dismiss link should use color-progressive and adapt accordingly (e.g. #36c in light mode, #88a3e8 in dark mode)

screenshot 43.png (1,504×1,319 px, 655 KB)

screenshot 42.png (1,504×1,319 px, 636 KB)