Page MenuHomePhabricator

Button: create small size
Closed, ResolvedPublic

Assigned To
Authored By
bmartinezcalvo
Nov 28 2023, 5:25 PM
Referenced Files
F61272541: image.png
Jun 2 2025, 5:54 PM
F61272588: image.png
Jun 2 2025, 5:54 PM
F37124629: image.png
May 12 2025, 4:24 PM
F35568874: Screen Shot 2022-10-14 at 8.14.55 AM.png
Nov 28 2023, 6:10 PM
F36352837: image.png
Nov 28 2023, 5:52 PM
F36353886: image.png
Nov 28 2023, 5:52 PM
F41543798: image.png
Nov 28 2023, 5:52 PM
F41543768: Captura de pantalla 2023-11-28 a las 18.24.04.png
Nov 28 2023, 5:25 PM

Description

Background

At the moment, Codex Button includes 2 sizes:

  • Medium (32px)
  • Large (44px)

We need to explore and implement a new small size (20px/24px?) to cover the following use cases:

Known use cases

Captura de pantalla 2023-11-28 a las 18.24.04.png (962×802 px, 53 KB)
"Hide" button in the Table of contents T351660: Align buttons in pinnable menus with Codex styles
image.png (1,528×1,068 px, 329 KB)
Inline actions in groups on the History, Watchlist, Recent Changes etc pages.
image.png (836×82 px, 19 KB)
IP reveal button for the Temp accounts work.
image.png (582×106 px, 24 KB)
The reply button on Talk pages (Discussion Tools).
Screen Shot 2022-10-14 at 8.14.55 AM.png (934×338 px, 84 KB)
Edit on section headings.
image.png (836×82 px, 19 KB)
Proposed "show IP" quiet button for IP Masking (will have same custom CSS to adjust line-height).
image.png (990×516 px, 45 KB)
"Details" button in Wikifunctions.

Design spec

Specifications:

  • Button size: @size-150 (24px)
  • Icon size: @icon-small
  • Text:
    • @font-size-medium
    • @font weight-bold by default (with option of Normal)
  • Padding:
    • Between StartIcon and Label: @spacing-25 (4px)
    • Left and Right sides: @spacing-35 (6px)
Recommendations for Small Button
  • Use Small Button when you need to put a button alongside or between texts or when space is limited.
  • Use non-capital letter to make it fit better with surrounding texts.
  • Use Bold weight by default. Normal weight is permissible in some specific cases to blend more with surrounding texts.
  • Avoid using the Small Button on touchable screens and use Medium Button size (32px) if possible.

Open questions

Add here the questions to be answered in order to design and implement the component

Acceptance criteria (or Done)

Design

  • Design the Figma spec sheet and add it in this task
  • Add the Small Button size in the Figma library. This step will be done by a DST member.
  • Update guidelines on Codex for "Using links and buttons" in Style Guide

Code

  • Implement the component in Codex

Event Timeline

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

hi @bmartinezcalvo - There are many other use cases as well documented on T327426#8549928 - can these please be added to the known use cases in the description?

Inline actions in groups on the History, Watchlist, Recent Changes etc pages:

image.png (1,528×1,068 px, 329 KB)

IP reveal button for the Temp accounts work:

image.png (836×82 px, 19 KB)

The reply button on Talk pages (Discussion Tools):

image.png (582×106 px, 24 KB)

hi @bmartinezcalvo - There are many other use cases as well documented on T327426#8549928 - can these please be added to the known use cases in the description?

Inline actions in groups on the History, Watchlist, Recent Changes etc pages:

image.png (1,528×1,068 px, 329 KB)

IP reveal button for the Temp accounts work:

image.png (836×82 px, 19 KB)

The reply button on Talk pages (Discussion Tools):

image.png (582×106 px, 24 KB)

@RHo thank you! Added all these use cases in the task description.

Based on the Vector22 context, I think neutral-quiet-progressive buttons style in Codex with 24px height and 4px left/right margins will work for our small button.

See T351660 for rationale and explorations.

Should part of the work in this task include determining the need for a different button style for smaller buttons for the use-cases listed, not only creating a smaller version of existing styles?.

This is something that @DTorsani-WMF could potentially work on to taking over from the explorations started earlier for the inline button group use case. See task description in T327426 for more info.

CCiufo-WMF renamed this task from Button: Small size to Button: Evaluate the need for smaller/inline button styles.Dec 19 2023, 4:51 PM
bmartinezcalvo renamed this task from Button: Evaluate the need for smaller/inline button styles to Button: create small size.May 12 2025, 4:23 PM
bmartinezcalvo updated the task description. (Show Details)
bmartinezcalvo updated the task description. (Show Details)
bmartinezcalvo added a subscriber: AAlhazwani-WMF.

Let's please ensure that we

  1. go for a minimum size of 24x24 px (which would be a WCAG AAA success criteria, but it's also basic usability) and not lower, while many usability and mobile guidelines (like Apple's and Google's) recommend 44x44 pixels (Apple Human Interface Guidelines) or 48x48 dp (Google Material Design) in regards to better usability, for example on touch interfaces, also for users with motion limitations and some more.
  2. We document extensively that using this size should be the absolute exception and not the rule. Also from a consistency and visual harmony perspective, to not run into views where smaller and default buttons are mixed and mashed.

Another example: TSP has an icon-only small button which will trigger a popover for User Info Card.

image.png (2,216×868 px, 327 KB)

image.png (2,062×994 px, 320 KB)

Another example: TSP has an icon-only small button which will trigger a popover for User Info Card.

image.png (2,216×868 px, 327 KB)

image.png (2,062×994 px, 320 KB)

What are the dimensions of the button?

Another example: TSP has an icon-only small button which will trigger a popover for User Info Card.

image.png (2,216×868 px, 327 KB)

image.png (2,062×994 px, 320 KB)

What are the dimensions of the button?

It uses a 24x24px small button with 14px icon set within it. It's based on the WIP Figma button that was shared.

@gonyeahialam has been contributing this design and these are the final decisions on the Small Button size:

Specifications:

  • Button size: @size-150 (24px)
  • Icon size: @icon-small
  • Text:
    • @font-size-medium
    • @font weight-bold by default (with option of Normal)
  • Padding:
    • Between StartIcon and Label: @spacing-25 (4px)
    • Left and Right sides: @spacing-35 (6px)
Recommendations for Small Button
  • Use Small Button when you need to put a button alongside or between texts or when space is limited.
  • Use non-capital letter to make it fit better with surrounding texts.
  • Use Bold weight by default. Normal weight is permissible in some specific cases to blend more with surrounding texts.
  • Avoid using the Small Button on touchable screens and use Medium Button size (32px) if possible.

This task is ready for implementation. Thank you @gonyeahialam for this contribution!

gonyeahialam subscribed.

@DSmit-WMF Volunteered to implement this and would update us when she begins work

@DSmit-WMF Volunteered to implement this and would update us when she begins work

Great, thank you @gonyeahialam and @DSmit-WMF!

Question @gonyeahialam and @bmartinezcalvo .

  1. It says 'Use Bold weight by default. Normal weight is permissible in some specific cases to blend more with surrounding texts.'. Does this mean we need to support setting a weight via props?

The weight prop is already used for 'normal', 'primary', 'quiet' :

/**
		 * Visual prominence of Button.
		 *
		 * @values 'normal', 'primary', 'quiet'
		 */
		weight: {
			type: String as PropType<ButtonWeight>,
			default: 'normal',
			validator: buttonWeightValidator
		},

So this would be something new. and that also means it can be used for the other button variants, because people can combine props as they want. Also wondering what is a good name then since bold = normal now.

  1. Icons are inserted by the user inserting the button so the user is responsible for the correct icon size. we could add this to the docs to use the small icon size

Hey @DSmit-WMF,

  1. It says 'Use Bold weight by default. Normal weight is permissible in some specific cases to blend more with surrounding texts.'. Does this mean we need to support setting a weight via props?

DST discussed this and decided that the normal font weight for small buttons shouldn't be built into the Codex Button component, since it would be confusing to add a prop to cover this especially since it only applies to a single button size. Instead, people can set the style font-weight: @font-weight-normal on small buttons in their feature code.

DSmit-WMF changed the task status from Open to In Progress.Jun 18 2025, 4:30 PM

Change #1160902 had a related patch set uploaded (by Daphne Smit; author: Daphne Smit):

[design/codex@main] Button: create small size

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

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

[design/codex@main] docs, Button: Reformat button size docs

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

Change #1160902 merged by jenkins-bot:

[design/codex@main] Button: create small size

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

Change #1162939 merged by jenkins-bot:

[design/codex@main] docs, Button: Reformat button size docs

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

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

[mediawiki/core@master] Update Codex from v2.1.0 to v2.2.0

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

Change #1163459 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v2.1.0 to v2.2.0

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

hey @bmartinezcalvo, could you please check the remaining acceptance criteria and close this if they're done?