mediawiki-extensions-Cite/modules/ext.cite.style.css
Subramanya Sastry 47a622c001 Parsoid CSS: Fix counters needed for ol.mw-references
* Some wikis need a X.Y style numbering where X is the
  counter for the reference number in the list (mw-references),
  and Y is the named-ref counter (mw-ref-linkback).

* Rather than have the mw-references counter be defined for
  specific languages, it is useful to have defined for all
  wikis and use it where needed.

* Not sure why the ol.mw-references reset the mw-ref-linkback
  counter. It needed to be reset for every item.

* While at it, made a couple CSS rules in kn and fa be more
  specific so it is clearly what they are used for.

Change-Id: I6dd35303f134cc4996e134867ecc2c0db7a5411f
2022-11-04 10:17:09 -05:00

115 lines
3 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 */
.reference a[ data-mw-group ]:after {
content: '[' attr( data-mw-group ) ' ' counter( mw-Ref, decimal ) ']';
}
/* Groups with special appearance */
.reference a[ data-mw-group='decimal' ]:after {
content: '[' counter( mw-Ref, decimal ) ']';
}
.reference a[ data-mw-group='lower-alpha' ]:after {
content: '[' counter( mw-Ref, lower-alpha ) ']';
}
.reference a[ data-mw-group='upper-alpha' ]:after {
content: '[' counter( mw-Ref, upper-alpha ) ']';
}
.reference a[ data-mw-group='lower-greek' ]:after {
content: '[' counter( mw-Ref, lower-greek ) ']';
}
.reference a[ data-mw-group='lower-roman' ]:after {
content: '[' counter( mw-Ref, lower-roman ) ']';
}
.reference a[ data-mw-group='upper-roman' ]:after {
content: '[' counter( mw-Ref, upper-roman ) ']';
}
.reference a[ data-mw-group='error-test' ]:after {
content: '[' counter( mw-Ref, symbols( cyclic 'first' 'second' 'last!' ) ) ']';
}
/* Without a group */
.reference 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. */
counter-reset: mw-references list-item 0;
}
ol.mw-references > li {
counter-increment: 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-ref-linkback, lower-alpha );
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;
}