Page MenuHomePhabricator

[breaking change] Font modes: Introduce font modes to Codex
Closed, ResolvedPublic5 Estimated Story Points

Description

This task covers adding new font modes to Codex. Other tasks cover testing and documentation of these modes.

Lookup table before and with font modes
Design token Less varOLD: currentNEW: default (medium)smalllargex-large
@font-size-x-small0.75rem0.75rem0.625rem0.875rem1rem
@font-size-small0.875rem0.875rem0.75rem1rem1.125rem
@font-size-medium1rem1rem0.875rem1.125rem1.25rem
@font-size-large1.125rem1.125rem1rem1.25rem1.375rem
@font-size-x-large1.25rem1.25rem1.125rem1.375rem1.5rem
@font-size-xx-large1.5rem1.5rem1.375rem1.625rem1.75rem
@font-size-xxx-large1.75rem1.75rem1.625rem1.875rem2rem
@line-height-xxx-small1.251.25rem1.125rem1.375rem1.625rem
@line-height-xx-small1.3751.375rem1.25rem1.625rem1.75rem
@line-height-x-smallnone1.4285714rem1.125rem1.625rem1.75rem
@line-height-small1.57142851.5714285rem1.25rem1.75rem1.875rem
@line-height-medium1.61.625rem1.375rem1.75rem1.875rem
@line-height-largenone1.75rem1.625rem1.875rem2rem
@line-height-x-largenone1.875rem1.75rem2rem2.125rem
@line-height-xx-largenone2.125rem2rem2.25rem2.375rem
@line-height-xxx-largenone2.375rem2.25rem2.5rem2.625rem
Breaking change

Since font-size, line-height, and size-icon tokens will now point to CSS custom properties, they will no longer work in Less functions or in mathematical operations without the CSS calc() function. See subtasks for mitigation of known issues.

Known issue(s)
  • Checkbox and Radio height/centering is a pixel off in large and x-large - this has been discussed and we have determined that this would likely require a rebuild of these components, and that for now we will prioritize making small and default font modes look good here, which has been done.
  • The small font mode features a 10px font-size equivalent with font-size-x-small: 0.625rem. This is the only occurrence of a font-size under the accessibility guidance of 12px as smallest element, but for product reasons we kept it as exception in the mode.

Acceptance criteria

Implementation

  • New font modes tokens files are added to the design tokens package
  • Font modes with 14px, 16px, 18px, and 20px base font sizes are are covered
  • No breaking design token changes - tokens are backward-compatible and none are removed
  • Typography mixins are created and made public to Codex users
  • Component changes have been thoroughly reviewed at each font mode and are acceptable with no major unintended visual changes

Documentation

  • Each DST engineer has reviewed the ADR and the main patch, posing questions as needed to understand the work
  • Update Typography style guide page with new font scale and modes

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

For completion on small mode 10px equivalent, I've proposed making extra small equal small of 12px equivalent font size token there and only there.

lwatson changed the point value for this task from 5 to 3.Mar 17 2025, 5:06 PM
CCiufo-WMF raised the priority of this task from Medium to High.Mar 17 2025, 5:07 PM

Test wiki created on Patch demo by ATomasevich (WMF) using patch(es) linked to this task:
http://patchdemo.wmcloud.org/wikis/c2a7648c04/w/

Test wiki created on Patch demo by ATomasevich (WMF) using patch(es) linked to this task:
http://patchdemo.wmcloud.org/wikis/331ce38df5/w/

Change #1130779 had a related patch set uploaded (by VolkerE; author: VolkerE):

[design/codex@main] build: Set Less to rely on 'strict' math config

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

Test wiki on Patch demo by ATomasevich (WMF) using patch(es) linked to this task was deleted:

http://patchdemo.wmcloud.org/wikis/331ce38df5/w/

Test wiki created on Patch demo by ATomasevich (WMF) using patch(es) linked to this task:
http://patchdemo.wmcloud.org/wikis/cedcfe0d08/w/

Change #1123662 had a related patch set uploaded (by Dtorsani; author: Anne Tomasevich):

[design/codex@main] docs: Adjust styles and format on Style Guide Typography page

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

Test wiki created on Patch demo by ATomasevich (WMF) using patch(es) linked to this task:
http://patchdemo.wmcloud.org/wikis/4d683853d7/w/

CCiufo-WMF changed the task status from Open to Stalled.Mar 31 2025, 4:56 PM
CCiufo-WMF removed the point value 3 for this task.
CCiufo-WMF removed a subscriber: Sarai-WMDE.

Test wiki created on Patch demo by ATomasevich (WMF) using patch(es) linked to this task:
http://patchdemo.wmcloud.org/wikis/7a0895047d/w/

AnneT renamed this task from Font modes: Introduce font modes to Codex to [breaking change] Font modes: Introduce font modes to Codex.Apr 3 2025, 5:12 PM
AnneT updated the task description. (Show Details)
CCiufo-WMF changed the task status from Stalled to Open.Apr 14 2025, 5:10 PM
CCiufo-WMF set the point value for this task to 5.

Test wiki created on Patch demo by ATomasevich (WMF) using patch(es) linked to this task:
https://patchdemo.wmcloud.org/wikis/12f7395c2d/w/

Change #1123503 merged by jenkins-bot:

[design/codex@main] [BREAKING CHANGE] tokens, styles: Introduce font modes and redesign type scale system

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

Change #1123662 merged by jenkins-bot:

[design/codex@main] docs: Adjust styles and format on Style Guide Typography page

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

Change #1139942 had a related patch set uploaded (by VolkerE; author: VolkerE):

[mediawiki/core@master] Update Codex from v1.23.0 to 2.0.0-rc.1

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

Test wiki created on Patch demo by ATomasevich (WMF) using patch(es) linked to this task:
https://patchdemo.wmcloud.org/wikis/f82f2e0c2b/w/

Test wiki on Patch demo by ATomasevich (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org/wikis/12f7395c2d/w/

Test wiki on Patch demo by ATomasevich (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org/wikis/cedcfe0d08/w/

Test wiki on Patch demo by ATomasevich (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org/wikis/4d683853d7/w/

Test wiki on Patch demo by ATomasevich (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org/wikis/7a0895047d/w/

Test wiki on Patch demo by ATomasevich (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org/wikis/c2a7648c04/w/

Test wiki on Patch demo by ATomasevich (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org/wikis/f82f2e0c2b/w/

Test wiki created on Patch demo by ATomasevich (WMF) using patch(es) linked to this task:
https://patchdemo.wmcloud.org/wikis/e49103389b/w/

Test wiki on Patch demo by ATomasevich (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org/wikis/e49103389b/w/

Change #1139942 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v1.23.0 to 2.0.0-rc.1

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

AnneT updated the task description. (Show Details)

On Vector classic, it seems that this changeset unexpectedly increased the font size of warning messages.

See, for example: https://fr.wikipedia.org/wiki/Sp%C3%A9cial:Contributions/NTMVA?useskin=vector

The message has a font-size: 1rem, meaning 16px, whereas the rest of the page has a base font size of 14px.

I pinpointed the font-size introduction in Message.vue.

On Vector classic, it seems that this changeset unexpectedly increased the font size of warning messages.

See, for example: https://fr.wikipedia.org/wiki/Sp%C3%A9cial:Contributions/NTMVA?useskin=vector

The message has a font-size: 1rem, meaning 16px, whereas the rest of the page has a base font size of 14px.

I pinpointed the font-size introduction in Message.vue.

Thanks for reporting this @Od1n, we're looking into a fix now.

Again on Vector classic, I just noticed another similar issue: on history pages, the font size of the "Compare selected revisions" button is too large.

See, for example: https://en.wikipedia.org/w/index.php?title=Main_Page&action=history&useskin=vector

Here's what I discovered when inspecting the elements:

--font-size-medium is not defined

(Same with other variables: --line-height-small, etc.)

That seems to be the explanation…

Test wiki on Patch demo by 1Esk19 using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org//wikis/ffa0e13429/w/

It's been six months since I reported the font size issues in Vector classic caused by missing CSS variables like --font-size-medium.

The problem is still there. At this point, it honestly feels like nobody cares.

Can we please get this addressed?