Page MenuHomePhabricator

Replace Less variable negation `-@` with CSS `calc()`
Closed, ResolvedPublic1 Estimated Story Points

Description

Background

While the Less compiler allows to negate a Less var independently of the contents, CSS custom properties don't work that way.

With the introduction of T387778: [breaking change] Font modes: Introduce font modes to Codex, the @size-icon-* and @font-size-* token values are changing to feature custom properties.

  • -@size CodeSearch
  • @font-size isn't used with negations, no occurrences of -@font-size

Goal

Replace negations with calc( -1 * @design-token-name )

Acceptance criteria

  • All cases of negation are replaced

Event Timeline

CCiufo-WMF moved this task from Inbox to Needs Refinement on the Design-System-Team board.

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

[mediawiki/extensions/CommunityRequests@master] styles: Harden design token usage in calculations

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

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

[mediawiki/extensions/GrowthExperiments@master] styles: Harden design token usage in calculations

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

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

[design/codex@main] styles: Harden design token usage in calculations

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

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

[mediawiki/extensions/CheckUser@master] styles: Harden design token usage in calculations

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

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

[mediawiki/skins/Vector@master] styles: Harden design token usage in calculations

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

Change #1129590 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] styles: Harden design token usage in calculations

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

Change #1129600 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] styles: Harden design token usage in calculations

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

Change #1129589 merged by jenkins-bot:

[mediawiki/extensions/CommunityRequests@master] styles: Harden design token usage in calculations

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

Change #1129598 merged by jenkins-bot:

[design/codex@main] styles, docs: Harden design token usage in calculations

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

Putting to 'blocked' column as the last bit is Web team review.

CCiufo-WMF changed the task status from Open to In Progress.Mar 31 2025, 5:21 PM
CCiufo-WMF assigned this task to Volker_E.

Change #1133258 had a related patch set uploaded (by Eric Gardner; author: Eric Gardner):

[mediawiki/core@master] Update Codex from v1.21.1 to v1.22.0

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

Test wiki created on Patch demo by Eric C Gardner using patch(es) linked to this task:
http://patchdemo.wmcloud.org/wikis/59d55f2723/w/

Change #1133258 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v1.21.1 to v1.22.0

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

Change #1129602 merged by jenkins-bot:

[mediawiki/skins/Vector@master] styles: Harden design token usage in calculations by using `calc()`

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

Volker_E updated the task description. (Show Details)

Resolving this, as the Codex part has already been part of the last v1.22.0 release and only Vector patch, which was merged today was the remainder.

Test wiki on Patch demo by Eric C Gardner using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org/wikis/59d55f2723/w/