From 8dad1703aff9f11ef7e967b48eff2cac36ffb96b Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Thu, 29 Mar 2018 11:43:55 -0700 Subject: [PATCH] Special handling for links without href attribute The link change overrides link colors in last modified, talk button and main menu. This approach was obviously flawed. Rather than enter a specificity war let's instead limit the styles to links which do not have an href. Volker you were right... * Revert "Last modified links should not be progressive blue" This reverts commit bc045b78a296088852c4e33451c9a250102fe79d. * Revert "Do not style links without href attribute" This reverts commit daa6ad5145d2415bfdaa9db792fc14729b916e20. * Apply a not selector for links Certain links (including links inside navboxes) render links to themselves - for example the navbox on the San Francisco article (provided it is not removed by wgMFRemovableClasses) These links should be visually distinguished from normal links. The not selector has support from IE9 onwards and given our browser matrix and the low impact of if this fallback fails this is a perfectly acceptable usecase. Bug: T181472 Change-Id: I61b05e3c223f2ba5314aecdf26b8a0ee8caa6524 --- resources/skins.minerva.base.styles/print/footer.less | 2 +- resources/skins.minerva.base.styles/ui.less | 2 +- resources/skins.minerva.content.styles/links.less | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/resources/skins.minerva.base.styles/print/footer.less b/resources/skins.minerva.base.styles/print/footer.less index be2a065..aae452e 100644 --- a/resources/skins.minerva.base.styles/print/footer.less +++ b/resources/skins.minerva.base.styles/print/footer.less @@ -28,7 +28,7 @@ } .last-modified-bar, - .last-modified-bar a[href] { + .last-modified-bar a { font-weight: bold !important; color: #000 !important; } diff --git a/resources/skins.minerva.base.styles/ui.less b/resources/skins.minerva.base.styles/ui.less index 3474fe4..2b372ff 100644 --- a/resources/skins.minerva.base.styles/ui.less +++ b/resources/skins.minerva.base.styles/ui.less @@ -46,7 +46,7 @@ body { color: @colorGray5; transition: background-color 0.2s ease, color 0.2s ease; - a[href], + a, a:visited { color: @colorGray5; // If browser supports diff --git a/resources/skins.minerva.content.styles/links.less b/resources/skins.minerva.content.styles/links.less index a421568..11b155d 100644 --- a/resources/skins.minerva.content.styles/links.less +++ b/resources/skins.minerva.content.styles/links.less @@ -8,12 +8,14 @@ * links can be differentiated from other links. Thus we only apply the linkColor to links with href * attributes. */ -a[href] { - color: @linkColor; +/* stylelint-disable no-descending-specificity */ +a:not( [href] ) { + color: @colorGray2; } a { text-decoration: none; + color: @linkColor; &:visited { color: #5a3696;