Page MenuHomePhabricator

[WtC-M3] [QB] Use Codex tokens to style QB’s font styles
Closed, ResolvedPublic5 Estimated Story Points

Description

Problem

The Query Builder's user interface was styled using WiKit tokens. With the WiKit design system being superseded by Codex, the official Wikimedia design system. The utilization of WiKit tokens is not recommended, and they should be replaced in order to reduce maintenance costs and ensure consistency.

Solution

We have to replace the WiKit tokens used to style the Query Builder's font styles by their Codex equivalents.
Besides links, all fonts in the Query Builder UI can be replaced by three styles: h4, Body M and Body S. Only the font weight and color of said styles can vary, as indicated by the specs.

To support the replacement, here's a WiKit to Codex tokens mapping. You can find the WiKit tokens matched with their corresponding Codex token.

Considerations

Files where font tokens are used (please beware the list might be incomplete!):

Acceptance criteria
  • WiKit tokens used to define the font styles of the Query Builder app are replaced by Codex tokens

Event Timeline

Arian_Bozorg renamed this task from Use Codex tokens to style QB’s font styles to [SW] [WtC-M3] [QB] Use Codex tokens to style QB’s font styles.Mar 27 2024, 9:47 AM
Arian_Bozorg edited projects, added Wikidata Query Builder; removed Mismatch Finder.
Arian_Bozorg renamed this task from [SW] [WtC-M3] [QB] Use Codex tokens to style QB’s font styles to [WtC-M3] [QB] Use Codex tokens to style QB’s font styles.Mar 27 2024, 9:51 AM

Mismatch Finder has a typography.scss file that holds the mixins. we might want to do something similar for the Query Builder.

karapayneWMDE set the point value for this task to 5.Apr 16 2024, 8:17 AM

Change #1036231 had a related patch set uploaded (by Hasan Akgün (WMDE); author: Hasan Akgün (WMDE)):

[wikidata/query-builder@master] Use Codex tokens to style QB’s font styles

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

Change #1036231 merged by jenkins-bot:

[wikidata/query-builder@master] Use Codex tokens to style QB’s font styles

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

Hey there! Just a heads-up that I didn't get a chance to review this task. I can check production and create a task with fixes in case they're needed, but it might be a better idea to rely on branch deployment to allow design verification in the future. Would that be possible? It'd be a great way to prevent friction.

Hey there! Just a heads-up that I didn't get a chance to review this task. I can check production and create a task with fixes in case they're needed, but it might be a better idea to rely on branch deployment to allow design verification in the future. Would that be possible? It'd be a great way to prevent friction.

Hello Sarai, thanks for the heads-up! Here is the branch deployment link for you: https://1036231--clicky-sparqly.netlify.app/, I will do it beforehand next time, sorry for delay.

Oh, sorry, it should have been in the product verification column then, I didn't realize you didn't see it.

Thank you both, and no problem! I'll add the findings here, and we can decide if should reopen this task or rather create a separate one:

IssueScreenshot (if applicable)
Inline links in .querybuilder__description are broken
Screenshot 2024-06-06 at 16.14.35.png (412×1 px, 129 KB)
Inline links in the Footer are broken
Screenshot 2024-06-06 at 16.46.04.png (638×954 px, 90 KB)
The line-height value of the body-m mixin should be $line-height-medium
All headings should reuse the same style/mixin: heading-4. The style applies to .querybuilder__description-heading ("About this tool"), .querybuilder__query-title ("Query"), .querybuilder__setting-header ("Settings") and the <h2> in .querybuilder-result__header. We don't need any other heading mixins in the context of the Query builder.
The color of the heading-4 mixin should be $color-emphasized instead of $color-base
Screenshot 2024-06-06 at 16.20.22.png (1×1 px, 339 KB)
The color of querybuilder-footer__title texts should be $color-emphasized to enhance contrast and hierarchy
Screenshot 2024-06-06 at 16.50.31.png (688×1 px, 160 KB)

Change #1041563 had a related patch set uploaded (by Hasan Akgün (WMDE); author: Hasan Akgün (WMDE)):

[wikidata/query-builder@master] Fix typography according to Codex style

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

Thank you both, and no problem! I'll add the findings here, and we can decide if should reopen this task or rather create a separate one:

IssueScreenshot (if applicable)
Inline links in .querybuilder__description are broken
Screenshot 2024-06-06 at 16.14.35.png (412×1 px, 129 KB)
Inline links in the Footer are broken
Screenshot 2024-06-06 at 16.46.04.png (638×954 px, 90 KB)
The line-height value of the body-m mixin should be $line-height-medium
All headings should reuse the same style/mixin: heading-4. The style applies to .querybuilder__description-heading ("About this tool"), .querybuilder__query-title ("Query"), .querybuilder__setting-header ("Settings") and the <h2> in .querybuilder-result__header. We don't need any other heading mixins in the context of the Query builder.
The color of the heading-4 mixin should be $color-emphasized instead of $color-base
Screenshot 2024-06-06 at 16.20.22.png (1×1 px, 339 KB)
The color of querybuilder-footer__title texts should be $color-emphasized to enhance contrast and hierarchy
Screenshot 2024-06-06 at 16.50.31.png (688×1 px, 160 KB)

Broken links is a problem about Vue3 migration and that will be fixed with another patch, I've addressed the other ones.

Change #1041563 merged by jenkins-bot:

[wikidata/query-builder@master] Fix typography according to Codex style

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

Thanks again for all the changes, @HasanAkgun_WMDE! There's only one small detail left to cover: the color of the heading-4 mixin should $color-emphasized instead of $color-base.

Change #1055960 had a related patch set uploaded (by Hasan Akgün (WMDE); author: Hasan Akgün (WMDE)):

[wikidata/query-builder@master] Fix heading 4 color

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

All looking good now! Thanks for all the changes 🙏🏻

Change #1055960 merged by jenkins-bot:

[wikidata/query-builder@master] Fix heading 4 color

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

Hey @HasanAkgun_WMDE 👋🏻 I'm sorry, but I just noticed a last misalignment between the specs and the code.

The following mixin:

@mixin ui-text-m($font-weight: $font-weight-normal) {
	font-family: $font-family-system-sans;
	font-size: $font-size-medium;
	font-weight: $font-weight;
	line-height: $line-height-xx-small;
	color: $color-base;
}

Should be removed and replaced by:

@mixin body-m {
	font-family: $font-family-system-sans;
	font-size: $font-size-medium;
	font-weight: $font-weight-normal;
	line-height: $line-height-medium;
	color: $color-base;
}

.querybuilder__description should use body-m instead of ui-text-m. That's all. Thank you! 🙏🏻

After having a quick call with @Sarai-WMDE , it seems done by another patch. I think we can proceed with this one.

Hey @HasanAkgun_WMDE 👋🏻 I'm sorry, but I just noticed a last misalignment between the specs and the code.

The following mixin:

@mixin ui-text-m($font-weight: $font-weight-normal) {
	font-family: $font-family-system-sans;
	font-size: $font-size-medium;
	font-weight: $font-weight;
	line-height: $line-height-xx-small;
	color: $color-base;
}

Should be removed and replaced by:

@mixin body-m {
	font-family: $font-family-system-sans;
	font-size: $font-size-medium;
	font-weight: $font-weight-normal;
	line-height: $line-height-medium;
	color: $color-base;
}

.querybuilder__description should use body-m instead of ui-text-m. That's all. Thank you! 🙏🏻

Change #1058577 had a related patch set uploaded (by Hasan Akgün (WMDE); author: Hasan Akgün (WMDE)):

[wikidata/query-builder@master] Fix footer typography

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

All texts look aligned with the design specs! Thanks for all the changes @HasanAkgun_WMDE 🙏🏻

As mentioned via DM already: Just a heads-up that some (?!) of the links included in the footer display a bigger size and line-height than those of the surrounding text. I added a note in a "Considerations" section in the Link replacement task, because I'm assuming that this will be fixed as part of that other ticket.

Change #1058577 merged by jenkins-bot:

[wikidata/query-builder@master] Fix footer typography

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

No further changes are needed after the latest merge ✅

There's still only the mentioned size inconsistency between footer links, which I hope can be fixed as part of T359859: [WtC-M3] [QB] Replace WiKit Link component by Codex's.

Screenshot 2024-07-31 at 19.49.56.png (416×1 px, 78 KB)

Thank you!