mediawiki-extensions-Cite/modules/ext.cite.styles.css
Subramanya Sastry ea4c16c037 Ensure Parsoid's linkback ref CSS counters are properly incremented
* Turned out there were 2 counters defined on references li nodes.
* One was added as part of the extends functionality added by WMDE's
  book referenceing project.
* The other one was added as part of Parsoid's Cite CSS work.
* Since the counter increments were defined separately and applied
  to the same node, only one of the increments would apply.
  This breaks counter rendering on wikis where custom wiki-specific
  rules aren't defined in that wiki's Mediawiki:Common.css
* Discovered after running visual diff tests after ad919e37
  was deployed.

Change-Id: I826faac3564d63b8a4fbd80015fd5cc8f0069b7a
2023-01-07 19:36:55 -06:00

106 lines
2.6 KiB
CSS

.mw-cite-backlink,
.cite-accessibility-label {
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.mw-references-columns {
-webkit-column-width: 30em;
-moz-column-width: 30em;
column-width: 30em;
margin-top: 0.3em;
}
/* Lines first column up nicely. */
.mw-parser-output .mw-references-columns .references {
margin-top: 0;
}
/* Avoid elements from breaking between columns */
.mw-references-columns li {
-webkit-column-break-inside: avoid;
page-break-inside: avoid;
break-inside: avoid-column;
}
ol.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!
**/
counter-reset: mw-ref-extends-parent mw-references list-item;
}
ol.references > li {
/**
* We have 2 counters for Parsoid HTML for different functionality.
* Make sure both are incremented!
**/
counter-increment: mw-ref-extends-parent mw-references;
counter-reset: mw-ref-extends-child;
}
ol.references .mw-extended-references {
list-style: none;
margin-left: 2em;
}
.mw-extended-references > li:before {
counter-increment: mw-ref-extends-child;
content: counter( mw-ref-extends-parent, decimal ) '.' counter( mw-ref-extends-child, decimal ) '. ';
}
sup.reference {
/* Isolation to fix references in case of RTL words at the end of a reference */
unicode-bidi: -moz-isolate;
unicode-bidi: -webkit-isolate;
unicode-bidi: isolate;
/* Don't allow a reference that includes a group name
to break in the end of the line */
white-space: nowrap;
/* Do not inherit bold or italic */
font-weight: normal;
font-style: normal;
}
/* Highlight clicked reference in blue to help navigation */
ol.references li:target,
sup.reference:target {
background-color: #eaf3ff;
}
/* Make cite errors "strong" */
.mw-ext-cite-error {
font-weight: bold;
/* For the case that the error is embedded in an element with a different direction */
unicode-bidi: embed;
}
.mw-ext-cite-error code {
/* As code is inheriting `#f8f9fa` as background color from `code`,
we need to increase contrast, by setting it to `transparent`. See T247903. */
background-color: transparent;
color: inherit;
/* Reduce inherited `padding` to make code fit in better in Resources list. */
padding: 1px 2px;
}
/* @noflip */
.mw-cite-dir-ltr .reference-text {
direction: ltr;
unicode-bidi: embed;
}
/* @noflip */
.mw-cite-dir-rtl .reference-text {
direction: rtl;
unicode-bidi: embed;
}