Commit graph

9 commits

Author SHA1 Message Date
Fomafix 656b00134e Use - instead of _ in LESS file names as language code
Change-Id: Ifcd6d8f927a651d13e8a01ac3995210292551bc8
2024-10-04 08:25:49 +00:00
Adam Wight ed8f499cb8 [refactor] finish abstracting the parsoid language style overrides
This should cause no user-facing changes.

Now the per-language overrides are expressed as pure data and styling
happens in a single file.  We can clearly see the types of
customization that have been made so far.

The CSS styling has also been enhanced, it can now be customized by
setting the CSS variables alone.

Bug: T370027
Change-Id: I2a1bf0365ac0c40991a4fe3f9a2c05dba8b7510c
2024-07-22 11:35:09 +02:00
thiemowmde 5ef0ccdaa6 Drop redundant fallbacks from parsoid-styles directory
These .less files are pointless because these languages have
fallbacks, and the .less file for the fallback is identical. The
behavior on the cluster will not change when we remove these
files. Another file with the same rules will be loaded instead.

I made this patch algorithmically by writing a piece of code that
iterates all existing .less files, checks if the language does
have fallbacks, and if one of the fallback .less files is
identical.

I also updated the existing test case to reflect what's going on.

Change-Id: Iab647956f7bf45e59da1af33ff2b3e81ad016b4c
2024-07-19 15:00:01 +02:00
thiemowmde f1bd3175fd Replace copy-pasted CSS snippets with LESS @imports
There is a lot of copy-pasting going on here. I hope the longer file
names also make it more obvious what's actually happening here.

Change-Id: I1cb5fe230cc8e2b90d97f92bc0156110afd6fc79
2024-07-19 14:33:02 +02:00
thiemowmde 883fa0a4ba Remove redundant per-language CSS identical with the default
This is identical with the CSS in ext.cite.parsoid.styles.less that's
active for all languages. The small per-language files should only
contain details that are different from the default.

Change-Id: Ic5470772e3138a7711d006dffa88e727f46bddd6
2024-07-19 12:11:36 +02:00
thiemowmde 6dc56deebd Rename all remaining .css files to .less
Change-Id: Ib41cad1e14243577c0a78becb2bc5cb6a50afa5d
2024-07-15 21:59:02 +02:00
Adam Wight 5b2cbc48bd Wire subref counting into the numbering renderer
Significant change is that footnote marker numbers are changed from
being a CSS-rendered marker to using the rendered "fallback" text.
This could be avoided using the same trick as is implemented for the
reflist: send an inline style variable with the marker content; but
let's only do this if really necessary for user experience.

Template-produced refs are still wrong, but this patch continues to
render them as they come from Parsoid, in the content script.

TODO in later patches:
* reuse of a subref is rendered as '3.2.1' in reader view but '3.0'
and '3.1' in the editor.
* subref numbering is backwards in RTL languages

Bug: T247921
Change-Id: Ieff73769f8ebbc3724f6a9b498487c4e7d09aa2e
2024-07-15 07:08:06 +00:00
Subramanya Sastry 3151ad5bfa Match minerva base styles for Parsoid
* The Minerva repository has a ".mw-ref" style which is Cite-specific
  so that makes be wonder if the expectation is for this to be in
  that file instead. That would be a really simple fix and be attached
  to the rule for sup as an extra selector.

* But, it seems like Cite extension is the right place for this.

* Found while trying to test Cite rendering with MFE.

Notes:
* This mirrors the style added in
Ieb91c1251839ff4bb54451aae69af9fb88322219


Change-Id: Iae1d391ef11e53110bfb758d45a0fbdf2addf62e
2024-05-23 23:21:15 +00:00
thiemowmde 644597c402 Move Parsoid-specific CSS into a subdirectory
The first two files have been added to the root modules/ directory
via I487095d in 2015. No problem.

Many, many more files have been added via I000b453 in 2022. It's
really hard to tell what is what since then.

I'm not absolutely sure what the naming convention for this folder
should be. Could as well be "localized-styles/" or just "Parsoid/".

Bug: T156350
Change-Id: Ibcf8c7a6db5400ed8a9811244a070e03ff372a39
2024-03-11 12:42:25 +00:00