Page MenuHomePhabricator

Document MediaWiki skin variables powers for designers and developers
Closed, ResolvedPublic2 Estimated Story Points

Description

Background

While a short overview has been provided on mediawiki.org when Codex tokens became the source for skin variables in April, the documentation is lacking depth.

Goal

Ensure that the documentation has a clear overview

  • why this source of truth is so powerful for MediaWiki interface authors
  • why it's advantageous to have one source of truth
  • how to customize them to team specific needs
  • what's the connex to Codex, the design system for Wikimedia and how to connect

I've provided a diagram for a better overview:


  • It features our three “WikimediaUI” based skins, Timeless for another Wikimedia deployed one, and two exemplary skins beyond.
    The tokens and vars provided are representations for the functionality, not always 1:1 values.
    One missing piece is, that skin.defaults are meant to be oriented on pure HTML looks with usability/accessibility in mind.

    Food for thought

    https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Kartographer/+/909660/5/modules/dialog/dialog.less#131

    Acceptance criteria

    • Expand the documentation to represent above points and reach out internally and externally on clarity. Based on feedback: amend.
    • Update Vue.js guidelines on mediawiki.org for design tokens usage

    Event Timeline

    First and foremost I need to say: The skin documentation on mediawiki.org is, similar to the skin architecture itself, an *ahem* inferior collection. Why do I feel I need to state this? Because satisfying to me documentation looks differently and I won't expand the scope to make it good, I will solely focus on the skin variables pieces!

    CCiufo-WMF triaged this task as Medium priority.Oct 24 2023, 1:45 PM
    CCiufo-WMF set the point value for this task to 2.Oct 30 2023, 6:30 PM

    The additional info added to Vue.js guidelines on mediawiki.org is helpful! Do you think it's worth mentioning in "style limitations" section that when using design tokens and mixins, the design tokens must be imported before the mixins.

    This snippet is from our code examples on Codex component demo pages:

    // Note: you must import the design tokens before importing the css-icon mixin
    @import (reference) "@wikimedia/codex-design-tokens/theme-wikimedia-ui.less";
    @import (reference) "@wikimedia/codex/mixins/css-icon.less";

    And the section "Write Vue3-compatible code" can be updated to share the history and current status of the Vue 2 to Vue 3 migration

    The additional info added to Vue.js guidelines on mediawiki.org is helpful! Do you think it's worth mentioning in "style limitations" section that when using design tokens and mixins, the design tokens must be imported before the mixins.

    This snippet is from our code examples on Codex component demo pages:

    // Note: you must import the design tokens before importing the css-icon mixin
    @import (reference) "@wikimedia/codex-design-tokens/theme-wikimedia-ui.less";
    @import (reference) "@wikimedia/codex/mixins/css-icon.less";

    This is not an issue when using Codex in MediaWiki, because importing mediawiki.skin.variables.less imports both the tokens and the mixins (and internally ensures they're imported in the right order). The documentation kind of says this:

    To access Codex design tokens and mixins inside Vue files, import MediaWiki skin variables @import 'mediawiki.skin.variables.less'; at the beginning of your style section.

    but that doesn't totally make clear that the warning from the Codex docs doesn't apply in MW.

    And the section "Write Vue3-compatible code" can be updated to share the history and current status of the Vue 2 to Vue 3 migration

    I agree, I think we should probably remove that entire section at this point.

    Was this actually in progress this sprint? Moving it back to Up Next to review what else is needed here.

    Volker_E updated the task description. (Show Details)

    @CCiufo-WMF It was actually on the sprint, b/c there was only one piece missing, the flow diagram that I've prepared and put in front of a few engineers to gather feedback. It's now featured on https://www.mediawiki.org/wiki/Codex#Using_Codex_design_tokens_in_MediaWiki_and_extensions and this section is interlinked with https://www.mediawiki.org/wiki/Manual:How_to_make_a_MediaWiki_skin#MediaWiki_Skin_Variables.
    So this is resolved.