Page MenuHomePhabricator

Introduce a consistent "small" font-size in Vector
Open, Stalled, MediumPublicBUG REPORT

Assigned To
Authored By
Jdrewniak
Nov 8 2023, 9:27 PM
Referenced Files
F41543628: Screenshot 2023-11-28 at 16.59.19.png
Nov 28 2023, 3:59 PM
Restricted File
Nov 28 2023, 3:58 PM
Restricted File
Nov 28 2023, 3:56 PM
F41543614: Screenshot_20231128_164659.png
Nov 28 2023, 3:49 PM
F41543578: Screenshot 2023-11-28 at 10.23.35 AM.png
Nov 28 2023, 3:40 PM
F41543576: Screenshot 2023-11-28 at 10.21.35 AM.png
Nov 28 2023, 3:40 PM
F41543569: Screenshot 2023-11-28 at 10.19.55 AM.png
Nov 28 2023, 3:40 PM
F41543551: Screenshot 2023-11-28 at 10.18.04 AM.png
Nov 28 2023, 3:40 PM
Tokens
"Love" token, awarded by Guycn2.

Description

In T346062, many of the existing small font-size in Vector 2022 (ranging from 11.67px to 13.33333px) were removed and replaced with the standard 14px font-size.
This change made it harder to distinguish certain sections (#siteSub, #contentSub) from the content.

In order to improve this situation, we should add another CSS variable --font-size-small with a rem based value, and use that in the affected sections, i.e #siteSub, #contentSub #footer.

A/C

  • A new CSS variable is added to ./resources/skins.vector.styles/CSSCustomProperties.less named --font-size-small
  • The value of that variable is set in rems, and computes to a pixel value of... (12? 12.5? 13px? TBD)
  • That variable is used to set the font-size for the following elements: #siteSub, #contentSub #footer.

QA steps

  • Verify that the font-size for the following elements: #siteSub #contentSub #footer are set to (12? 12.5? 13px? TBD) font-size.

Event Timeline

Guycn2 triaged this task as High priority.Nov 9 2023, 6:04 AM
Guycn2 awarded a token.
Guycn2 subscribed.
Aklapper raised the priority of this task from High to Needs Triage.Nov 9 2023, 8:28 AM

@Guycn2: Please don't set priority if you don't plan to work on this - thanks!

Jdlrobson lowered the priority of this task from High to Medium.
Jdlrobson raised the priority of this task from Medium to High.

I spoke to @Sarai-WMDE about this this morning, and she mentioned that Codex already has a small option in the scale. I think we just need to spec out which elements take on that style when we implement the new typescale options.

Do we need to change this before new font sizes are live @ovasileva?

JScherer-WMF lowered the priority of this task from High to Medium.Nov 20 2023, 6:17 PM

Jan and Justin are going to make a list of elements in the page that should have the small font size applied.

Jan to update the ticket with notes from their conversation and work out next steps. We'll move to next sprint for estimation.

After meeting with Justin last week, we catalogued the following elements in Vector that would need a "small" font-size applied to them.

Main namespace

elementdescriptioncurrent sizeexamples
#siteSubtaglines14px (was 12.8px)
enwiki
.mw-indicatorsmetadata12.15px (0.875em)
euwiki
frwiki
enwiki
.mw-body-content supcitations11.2px (80%)
Screenshot 2023-11-28 at 10.18.04 AM.png (156×736 px, 46 KB)
.mw-parser-output .reflist .referencesReferences12.6px (100%) <cite>
Screenshot 2023-11-28 at 10.19.55 AM.png (458×1 px, 132 KB)
.mw-editsection ainline edit links13px (small)
Screenshot 2023-11-28 at 10.21.35 AM.png (426×790 px, 91 KB)
.mw-footer lifooter12px (0.75em)
Screenshot 2023-11-28 at 10.23.35 AM.png (408×1 px, 116 KB)

Main namespace

It's not normally visible in the main namespace, but please also include #contentSub. See for example this screenshot (which has #contentSub outlined). It was one of the things that changed in T346062, and looks/feels a bit too prominent with the normal font-size.

Screenshot_20231128_164659.png (155×1 px, 26 KB)

After some investigating, the Design System Team settled on initial values for the small text style of 0.75em with a line-height of 1.5 (translates to 12px/19.2px under 16px).

Screenshot 2023-11-28 at 16.59.19.png (466×2 px, 109 KB)

Like the rest of Codex's typographic scale, this is a work-in-progress style, and we were hoping to test the appropriateness of its values with help from the Web team.

Something to keep in mind: we went for such a small size in order to generate contrast with the default UI and body size of 14px.

After some investigating, the Design System Team settled on initial values for the small text style of 0.75em with a line-height of 1.5 (translates to 12px/19.2px under 16px).

Screenshot 2023-11-28 at 16.59.19.png (466×2 px, 109 KB)

Like the rest of Codex's typographic scale, this is a work-in-progress style, and we were hoping to test the appropriateness of its values with help from the Web team.

Something to keep in mind: we went for such a small size in order to generate contrast with the default UI and body size of 14px.

That linked document appears to say that body text is 16px and that 0.75em is "font-size-x-small", not "font-size-small". Small text should be no smaller than 85% of the body text for accessibility. (See https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Accessibility#Font_size for the accessibility guidance provided at en.WP.)

I am confused.

I also agree with @jhsoby above that the size of #contentSub needs to be include. It was the primary motivation for the creation of this ticket.

Hey @Jonesey95! Sorry for the late reply. Answering inline:



That linked document appears to say that body text is 16px and that 0.75em is "font-size-x-small", not "font-size-small".



Correct. Those are design tokens from the Wikimedia design system typographic scale (WIP). The system's scale revolves around the heavily recommended base font size of 16px/1em. That central value is thus represented by the token font-size-medium, below that, 14px is represented by font-size-small and subsequently 12px by font-size-x-small. These are design system variables, and they don’t necessarily have to correspond with the name of the style, semantic labels or CSS keywords. 



Small text should be no smaller than 85% of the body text for accessibility (See https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Accessibility#Font_size for the accessibility guidance provided at en.WP.)



Thanks for sharing that resource! Regardless of the current value of small text in the scale, the teams will make sure that the consolidated size of small text in the context of Vector 2022 will not drop below 85% of the 14px base (12/14 = 0.857). For all other cases, we decided to go for a more universal solution for now (the Codex design system needs to provide unified styles for all Wikimedia projects and environments, beyond EN Wiki) and set that minimum 12px value for UI text in Wikimedia interfaces.

Jdlrobson moved this task from Incoming to Groomed on the Web-Team-Backlog board.

Needs updating to new task template.