Commit graph

4 commits

Author SHA1 Message Date
Subramanya Sastry 8d93818fc8 Use double-colon for pseudo-elements
* Linting rule has been fixed to accept these now.

Change-Id: I51d866ec18c9e1d675f43b3c60f3ad874bba041e
2023-03-14 16:49:10 -04:00
Subramanya Sastry b9400d1bf0 Parsoid CSS: mw-ref-linkback counter inits to -1, not 0
* This has always been a bug but was hidden because enwiki
  uses lower-alpha custom rendering and so we never noticed it
  when we tested this on enwiki.

* Fixing the default gets rid of the need to override this for
  every single language that defined a non-decimal counter.

* This also eliminates the need for some rules where the overrides
  were identical to the baseline definitions (counter-type is
  decimal and separator is '.').

Bug: T86782
Bug: T156350
Change-Id: I51f8a06c80bb897b66a0978b117fbc5560efd6cb
2023-02-07 20:59:23 -06:00
Subramanya Sastry d044c0c166 Parsoid CSS counters: Use child selectors instead of descendent selectors
In both cases:
(a) ref counter display for .mw-ref sups
(b) backlink labels in the references section for multiple named refs
the a-tags are direct children of the <sup>/<span> tag.

The child selectors are more precise. I am not really sure why we
went with descendant selectors in the first place.

Bug: T156350
Change-Id: If5be7cd14de40c2372f27ae5e2f32671c0a4e20c
2023-01-09 01:28:34 +00:00
Subramanya Sastry ad919e3730 Parsoid CSS: Add (script-generated) language-specific counters
* These files were generated with the script in
  I3623e42d4cad7975813892a8f0f7765b74a638c5

* These styles mimic the behavior of Language::formatNumNoSeparators
  and Language::localizeSeparators used by a couple of methods.

  ReferencesFormatter:referencesFormatEntryNumericBacklinkLabel
  calls ReferenceMessageLocalizer::localizeDigits which calls
  that core Language method.

  FootnoteMarkFormatter::linkRef calls localizeDigits as well.

  - '.reference a*' CSS rules mimic linkRef localization
  - 'span[rel="mw:referencedBy" ]*' rule mimics localization
     of referencesFormatEntryNumericBacklinkLabel

* Overrode all hand-crafted language CSS files from previous
  patches. The content of some of those hand-crafted CSS files
  will end up in those wikipedia's Common.css -- specifically
  for es, fr, sv wikipedias.

  sv and es have non-canonical formatting strings that aren't
  handled by the script right now and so leaving them behind.

  I need to look at fr output more carefully, so leaving that
  behind as well. But the generated ones are more accurate when
  combined with the wiki-specific CSS files genreated by the other
  script that processes site messages.

* Some files could potentially be removed by looking at
  language fallback chains, but the redundancy is not a
  problem for now.

* Tweak the resource loader script to use "_" instead of "-"
  when looking for a resource file.

Bug: T156350
Change-Id: I000b4538bf2be681b85df5813efed083458a4281
2022-11-18 11:50:20 -06:00