mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-23 23:33:54 +00:00
Align Vector link styles with Minerva
To make sure this is code-ified I have added the rule selector-max-specificity to check specificity and error if we ever attempt to change this and to also prevent us from writing overly complicated selectors (for now the default is based on the status quo) Additional change is required to skinStyle file to accomodate the new rule. Bug: T373989 Change-Id: I3921d1fb3a098faae8f5a8bdc895783f1b298daa
This commit is contained in:
parent
4f0137ff43
commit
eb74bc6080
|
@ -8,6 +8,13 @@
|
||||||
"declaration-property-unit-disallowed-list": null,
|
"declaration-property-unit-disallowed-list": null,
|
||||||
"no-descending-specificity": null,
|
"no-descending-specificity": null,
|
||||||
"selector-class-pattern": null,
|
"selector-class-pattern": null,
|
||||||
"selector-max-id": null
|
"selector-max-id": null,
|
||||||
|
"selector-max-specificity": "1,4,2"
|
||||||
|
},
|
||||||
|
"overrides": [ {
|
||||||
|
"files": [ "resources/skins.vector.styles/links.less" ],
|
||||||
|
"rules": {
|
||||||
|
"selector-max-specificity": "0,0,1"
|
||||||
}
|
}
|
||||||
|
} ]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,21 @@
|
||||||
a {
|
/*
|
||||||
|
* This not does apply to links with role button per discussion on T373989
|
||||||
|
* The `where` it used here as specificity is important so support overriding
|
||||||
|
* in skins and extensions.
|
||||||
|
* When changing this file - DO NOT disable stylelint rule selector-max-specificity
|
||||||
|
*/
|
||||||
|
a:where( :not( [ role='button' ] ) ) {
|
||||||
.cdx-mixin-link-base();
|
.cdx-mixin-link-base();
|
||||||
/* T373989 */
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Red links
|
// Red links - DO NOT disable stylelint rule selector-max-specificity for this rule.
|
||||||
a.new {
|
a:where( .new:not( [ role='button' ] ) ) {
|
||||||
.cdx-mixin-link-red();
|
.cdx-mixin-link-red();
|
||||||
}
|
}
|
||||||
|
|
||||||
// External links
|
// External links
|
||||||
// Use of `a` element selector for limiting generic class scope due to `.external` widespread usage.
|
// Use of `a` element selector for limiting generic class scope due to `.external` widespread usage.
|
||||||
|
/* stylelint-disable selector-max-specificity */
|
||||||
.mw-parser-output {
|
.mw-parser-output {
|
||||||
a {
|
a {
|
||||||
// Deal with long links (T327334, inspired by Minerva solution T62387)
|
// Deal with long links (T327334, inspired by Minerva solution T62387)
|
||||||
|
@ -34,12 +39,14 @@ a.new {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* stylelint-enable selector-max-specificity */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The following styles are copied from content.links.less
|
* The following styles are copied from content.links.less
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* self links */
|
/* self links */
|
||||||
|
/* stylelint-disable selector-max-specificity */
|
||||||
a.mw-selflink {
|
a.mw-selflink {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
@ -65,3 +72,4 @@ a.mw-selflink {
|
||||||
background: none !important; /* stylelint-disable-line declaration-no-important */
|
background: none !important; /* stylelint-disable-line declaration-no-important */
|
||||||
padding: 0 !important; /* stylelint-disable-line declaration-no-important */
|
padding: 0 !important; /* stylelint-disable-line declaration-no-important */
|
||||||
}
|
}
|
||||||
|
/* stylelint-enable selector-max-specificity */
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* stylelint-disable selector-max-specificity */
|
||||||
.skin-vector-legacy {
|
.skin-vector-legacy {
|
||||||
#pt-notifications-notice .mw-echo-notifications-badge,
|
#pt-notifications-notice .mw-echo-notifications-badge,
|
||||||
#pt-notifications-alert .mw-echo-notifications-badge {
|
#pt-notifications-alert .mw-echo-notifications-badge {
|
||||||
|
|
Loading…
Reference in a new issue