mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-12-24 05:33:24 +00:00
eb74bc6080
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
76 lines
2.1 KiB
Plaintext
76 lines
2.1 KiB
Plaintext
/*
|
|
* 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();
|
|
}
|
|
|
|
// Red links - DO NOT disable stylelint rule selector-max-specificity for this rule.
|
|
a:where( .new:not( [ role='button' ] ) ) {
|
|
.cdx-mixin-link-red();
|
|
}
|
|
|
|
// External links
|
|
// Use of `a` element selector for limiting generic class scope due to `.external` widespread usage.
|
|
/* stylelint-disable selector-max-specificity */
|
|
.mw-parser-output {
|
|
a {
|
|
// Deal with long links (T327334, inspired by Minerva solution T62387)
|
|
word-wrap: break-word;
|
|
}
|
|
|
|
a.external {
|
|
// Use copy of Codex/OOUI WikimediaUI theme's 'linkExternal' icon in progressive color.
|
|
// Note that CSSJanus is flipping the `ltr` in the URL to `rtl`.
|
|
// Therefore make sure that both icons are available and up-to-date.
|
|
background-image: url( images/link-external-small-ltr-progressive.svg );
|
|
background-position: center right;
|
|
background-repeat: no-repeat;
|
|
// Equivalent of `12px` at calculation base of `14px` is `0.857em`.
|
|
background-size: 0.857em;
|
|
padding-right: 1em;
|
|
|
|
// See T330712 for better understanding of this class and any future changes.
|
|
&.free {
|
|
word-break: break-all;
|
|
}
|
|
}
|
|
}
|
|
/* stylelint-enable selector-max-specificity */
|
|
|
|
/**
|
|
* The following styles are copied from content.links.less
|
|
*/
|
|
|
|
/* self links */
|
|
/* stylelint-disable selector-max-specificity */
|
|
a.mw-selflink {
|
|
color: inherit;
|
|
font-weight: bold;
|
|
text-decoration: inherit;
|
|
|
|
&:hover {
|
|
cursor: inherit;
|
|
}
|
|
}
|
|
|
|
/* Underline preference */
|
|
.mw-underline-always a {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.mw-underline-never a {
|
|
text-decoration: none;
|
|
}
|
|
|
|
/* Plainlinks - this can be used to switch
|
|
* off special external link styling */
|
|
.plainlinks a.external {
|
|
background: none !important; /* stylelint-disable-line declaration-no-important */
|
|
padding: 0 !important; /* stylelint-disable-line declaration-no-important */
|
|
}
|
|
/* stylelint-enable selector-max-specificity */
|