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
This commit is contained in:
Subramanya Sastry 2022-11-01 16:34:55 -05:00
parent ae70af75ad
commit 47a622c001
3 changed files with 9 additions and 17 deletions

View file

@ -57,12 +57,12 @@ span.mw-reflink-text {
/* 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 build-in "list-item" counter fixes this. */
counter-reset: mw-ref-linkback list-item;
Explicitly resetting the built-in "list-item" counter fixes this. */
counter-reset: mw-references list-item 0;
}
ol.mw-references > li {
counter-increment: mw-ref-linkback;
counter-increment: mw-references;
}
ol[ data-mw-group='lower-alpha' ].mw-references > li {
@ -73,14 +73,14 @@ ol[ data-mw-group='upper-alpha' ].mw-references > li {
list-style-type: upper-alpha;
}
[ rel~='mw:referencedBy' ] {
counter-reset: mw-ref-linkback 0;
}
[ 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 );

View file

@ -10,7 +10,7 @@
content: '[' counter( mw-Ref, persian ) ']';
}
[ rel~='mw:referencedBy' ] {
span[ rel~='mw:referencedBy' ] {
counter-reset: mw-ref-linkback -1;
}

View file

@ -10,18 +10,10 @@
content: '[' counter( mw-Ref, kannada ) ']';
}
[ rel='mw:referencedBy' ] {
span[ rel='mw:referencedBy' ] {
counter-reset: mw-ref-linkback -1;
}
ol.mw-references {
counter-reset: mw-references list-item 0;
}
ol.mw-references > li {
counter-increment: mw-references;
}
/* Linkbacks from <references> to <ref>s */
span[ rel='mw:referencedBy' ] a:before {
content: counter( mw-references, kannada ) '.' counter( mw-ref-linkback, kannada );