Page MenuHomePhabricator

Split the Vector "common" CSS module into two: one for Legacy Vector and one for Vector 2022
Closed, ResolvedPublic3 Estimated Story PointsBUG REPORT

Description

Due to the pervasive nature of font-size values in CSS (being defined in relative em's and used for values other than text, such as spacing etc.) there is a risk that changing font sizes in Vector 2022 could affect legacy Vector.

The chart below illustrates the interdependence between legacy and modern Vector CSS

Font size entry points in Vector.jpg (1×1 px, 160 KB)

tldr; That big thing in the middle called variables.less should be gone.

We should separate the CSS for legacy & Vector 2022 as much as possible. To do this, we need to:

  1. Remove the vector/resources/common module and copy the styles over to the skins.vector.styles and skins.vector.styles.legacy modules instead.
  2. Remove common variables.less file
    • Copy the variables into mediawiki.less/vector/mediawiki.skins.variables.less and mediawiki.less/vector-2022/mediawiki.skins.variables.less instead.

There's some room for code optimization here:

  • We should determine if mixins still need to be shared between legacy & modern Vector
  • We can remove variables that are not used by legacy Vector from it's respective variables file.

A/C

  • The Vector/resources/common folder no longer exists.
  • There are no visual changes caused by this refactor.
  • There are no bytesize increases caused by this refactor.

Event Timeline

ovasileva set the point value for this task to 3.Sep 14 2023, 5:50 PM

Change 962068 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Remove common module, merge files into skins.vector.styles and skins.vector.styles.legacy

https://gerrit.wikimedia.org/r/962068

Change 962659 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Remove unnecessary imports in component stylesheets, make variable and mixin imports consistent

https://gerrit.wikimedia.org/r/962659

Change 962068 abandoned by Bernard Wang:

[mediawiki/skins/Vector@master] Remove common module, merge files into skins.vector.styles and skins.vector.styles.legacy

Reason:

https://gerrit.wikimedia.org/r/962068

Change 962667 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Copy common styles into vector

https://gerrit.wikimedia.org/r/962667

Change 962668 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Copy common styles into legacy vector

https://gerrit.wikimedia.org/r/962668

Change 962685 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Remove common CSS module

https://gerrit.wikimedia.org/r/962685

Change 962659 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Remove unnecessary imports in component stylesheets, make variable and mixin imports consistent

https://gerrit.wikimedia.org/r/962659

Change 962667 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Copy common styles into vector

https://gerrit.wikimedia.org/r/962667

Change 962668 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Copy common styles into legacy vector

https://gerrit.wikimedia.org/r/962668

Change 962685 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Remove common CSS module

https://gerrit.wikimedia.org/r/962685

Edtadros added subscribers: Jdlrobson, Edtadros.

@Jdlrobson, I'm not sure how to test this.

This is covered by our Pixel tests. Both old Vector and modern Vector look good to me, when I compare origin/wmf/1.41.0-wmf.30 against master.

.

After I've been using the week of no new code work on Codex to get back to my favorite topics of getting rid of legacy and non-standard values across codebases in preparation for a number of great possible next achievements as preparing sunsetting WikimediaUI Base and introducing a standard Grid, I've stumbled today into this task.
I've provided over the course of today three simplifying patches, the second one in the chain for T331403.

There is a small mistake in the diagram on top, the skin.defaults are never used in Vectors. The diagram is correct though that Vector and Vector legacy are using the different Codex theme files, where the legacy one has solely been introduced for Vector's cause. Assigned further down, in the skin's power is the reference to those two theme files.

There's a broader and in my opinion problematic misconception altogether. The skin's mediawiki.skin.variables files are per definition not extendable. You can't add custom vars to the _mediawiki_.skin.variables files.
All the vars and all the naming is centralized in order to

  • have a standard nomenclature that our multiverse can rely and align on
  • have values that work in my extension in every skin
  • imply a feedback channel into possible skin extension needs to expand (or contract) the available skin variables in case something is so common and missing

It It should be the exception not the rule to have skin specific variables and they have to also live elsewhere in order to clarify their scope immediately.

So a shared variables file will, in current ResourceLoader technical setting of how the skin variables are meant to work be necessary!

I assume T349359 will address the issues @Volker_E raises above. Please open a new ticket for any other concerns we may have.