mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-15 19:10:15 +00:00
8412fb6406
* This was obviously a mistake for 'decimal' since the previous CSS would have rendered refs with the "decimal" group and refs without any group identically making it hard to distinguish between the two ref types. * But, not all wikis define custom messages for these "standard" ref groups. So, by providing default rendering for these, we would need custom overrides for wikis that didn't define them (the vast majority). Instead, for wikis that define them, define wiki-specific CSS for these groups that can be added to their Common.css pages. * Discovered as I set about trying to update CSS on wikis and my test wikitext with different groups were rendering decimal groups differently and I had no custom CSS for it anywhere. Bug: T86782 Change-Id: I5598580e96eead94bb09574b2af5cef3ce4241c5
107 lines
3.2 KiB
CSS
107 lines
3.2 KiB
CSS
/* CSS for Parsoid Cite extension */
|
|
|
|
.mw-ref-follow {
|
|
display: none;
|
|
}
|
|
|
|
/* Upstream bug in stylelint makes it complain aboout the case of 'mw-Ref' */
|
|
/* stylelint-disable value-keyword-case */
|
|
|
|
/* With a group set */
|
|
.mw-ref a[ data-mw-group ]:after {
|
|
content: '[' attr( data-mw-group ) ' ' counter( mw-Ref, decimal ) ']';
|
|
}
|
|
|
|
/* Without a group */
|
|
.mw-ref a:after {
|
|
content: '[' counter( mw-Ref, decimal ) ']';
|
|
}
|
|
|
|
/* Hide the default rendering in browsers that support content
|
|
* generation by selecting for :after pseudo-element. */
|
|
/* stylelint-disable-next-line selector-type-no-unknown */
|
|
x-thereisnoelementwiththisname:after,
|
|
span.mw-reflink-text {
|
|
display: none;
|
|
}
|
|
|
|
/* Style for linkbacks from <references> to <ref>s */
|
|
ol.mw-references {
|
|
/**
|
|
* Resetting *any* counter on an <ol> element messes up the built-in numbering in Firefox.
|
|
* Explicitly resetting the built-in "list-item" counter fixes this.
|
|
*
|
|
* We have 2 counters for Parsoid HTML for different functionality.
|
|
* Make sure both are reset!
|
|
*
|
|
* NOTE: This rule is a duplicate of the one present in ext.cite.styles.css
|
|
* but duplicating it here ensures no matter how the rules and files are
|
|
* refactored and which rule ends up applying on the loaded doc, both
|
|
* counters continue to be incremented. As of now, the rule in ext.cite.styles.css
|
|
* is the one that seems to be winning.
|
|
**/
|
|
counter-reset: mw-ref-extends-parent mw-references list-item;
|
|
}
|
|
|
|
ol.mw-references > li {
|
|
/**
|
|
* We have 2 counters for Parsoid HTML for different functionality.
|
|
* Make sure both are incremented!
|
|
*
|
|
* NOTE: This rule is a duplicate of the one present in ext.cite.styles.css
|
|
* but duplicating it here ensures no matter how the rules and files are
|
|
* refactored and which rule ends up applying on the loaded doc, both
|
|
* counters continue to be incremented. As of now, the rule in ext.cite.styles.css
|
|
* is the one that seems to be winning.
|
|
**/
|
|
counter-increment: mw-ref-extends-parent mw-references;
|
|
}
|
|
|
|
ol[ data-mw-group='lower-alpha' ].mw-references > li {
|
|
list-style-type: lower-alpha;
|
|
}
|
|
|
|
ol[ data-mw-group='upper-alpha' ].mw-references > li {
|
|
list-style-type: upper-alpha;
|
|
}
|
|
|
|
[ rel~='mw:referencedBy' ]:before {
|
|
content: '↑ ';
|
|
}
|
|
|
|
span[ rel~='mw:referencedBy' ] {
|
|
counter-reset: mw-ref-linkback 0;
|
|
}
|
|
|
|
span[ rel~='mw:referencedBy' ] a:before {
|
|
counter-increment: mw-ref-linkback;
|
|
content: counter( mw-references, decimal ) '.' counter( mw-ref-linkback, decimal );
|
|
line-height: 1;
|
|
vertical-align: super; /* <sup> use in Cite */
|
|
font-size: smaller; /* <sup> use in Cite */
|
|
}
|
|
|
|
span[ rel~='mw:referencedBy' ] a:after {
|
|
content: ' '; /* default separator outside <sup> */
|
|
line-height: 1;
|
|
}
|
|
|
|
span[ rel~='mw:referencedBy' ] a:last-child:after {
|
|
content: '';
|
|
}
|
|
|
|
/* Hide the default rendering in browsers that support content
|
|
* generation by selecting for :after pseudo-element. */
|
|
/* stylelint-disable-next-line selector-type-no-unknown */
|
|
x-thereisnoelementwiththisname[ rel='mw:referencedBy' ]:before,
|
|
span.mw-linkback-text {
|
|
display: none;
|
|
}
|
|
|
|
/* Previously, MediaWiki styled the warning class.
|
|
* It no longer does this, so style cite warnings through mw-ext-cite-warning. */
|
|
.mw-ext-cite-warning {
|
|
font-size: larger;
|
|
color: #ac6600;
|
|
}
|