From faf428550bc6a39963f928276c7eb2656577847b Mon Sep 17 00:00:00 2001 From: Jdrewniak Date: Thu, 3 Oct 2024 14:12:18 -0400 Subject: [PATCH] Use :where() for link styling Bug: T376394 Bug: T376361 Bug: T376126 Bug: T376098 Bug: T376363 Bug: T367892 Bug: T375994 Change-Id: I91b34a1b2bffaf1bebe2d60abd8b44877182d45e --- .../content/links.less | 25 +++++++------------ .../MainMenuItem.less | 1 + 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/resources/skins.minerva.base.styles/content/links.less b/resources/skins.minerva.base.styles/content/links.less index 8d7c1b376..2863a546a 100644 --- a/resources/skins.minerva.base.styles/content/links.less +++ b/resources/skins.minerva.base.styles/content/links.less @@ -2,6 +2,15 @@ @import '../../../minerva.less/minerva.variables.less'; @import '../../../minerva.less/minerva.mixins.less'; +/* This not does apply to links with role button per discussion on T373989 */ +a:where( :not( [ role='button' ] ) ) { + .cdx-mixin-link-base(); +} + +a:where( .new:not( [ role='button' ] ) ) { + .cdx-mixin-link-red(); +} + /** * Note that certain links may not have an href selector. * It is particularly important on wikis for example inside navbox's that these @@ -18,22 +27,6 @@ a:not( [ href ] ) { cursor: pointer; } -/* stylelint-disable selector-max-id */ -footer, -.cdx-message, -.mw-body-content, -#mw-content-subtitle { - /* This not does apply to links with role button per discussion on T373989 */ - a:not( [ role='button' ] ):not( .mw-selflink ):not( .cdx-card ) { - .cdx-mixin-link-base(); - - &.new { - .cdx-mixin-link-red(); - } - } -} -/* stylelint-enable selector-max-id */ - // External links // Use of `a` element selector due to its widespread usage and for limiting generic class scope. // `a.external` is for footer's “Creative Commons” license link only. diff --git a/resources/skins.minerva.mainMenu.styles/MainMenuItem.less b/resources/skins.minerva.mainMenu.styles/MainMenuItem.less index 5f3b30816..c7246e68b 100644 --- a/resources/skins.minerva.mainMenu.styles/MainMenuItem.less +++ b/resources/skins.minerva.mainMenu.styles/MainMenuItem.less @@ -19,6 +19,7 @@ .toggle-list-item__anchor:hover { box-shadow: inset 4px 0 0 0 @box-shadow-color-progressive--focus; + text-decoration: none; } .client-nojs & .skin-minerva-list-item-jsonly {