Page MenuHomePhabricator

Enable Icon components to support pre-defined sizes
Closed, ResolvedPublic3 Estimated Story Points

Description

Per T260617: Evaluate and decide on customizable icon sizes for Codex we need to support various pre-defined sizes in the Icon component. Right now there are 3 possible sizes of icon: "x-small" (12px), "small" (16px) and "medium" (20px). Icon size applies to both width and height, and there are corresponding min-height and min-width tokens as well. Finally, the sizes should also be applied in the SVG markup itself (viewbox dimensions, etc).

Use Cases
  • Chips component needs a small icon (currently this is achieved via CSS overrides, but it would be better to just pass props to Icon)
  • Link component (which is currently handled as a LESS mixin) should use a smaller icon size when an external link icon is included with the text
  • Others?
Design
Acceptance criteria (or Done)
  • Add size properties to the Icon component: medium, small and x-small (20px, 16px and 12px canvas respectively). medium is the default and will be used if no other size prop is provided.
    • Add 'warning' message for x-small being only for exceptional usage, as they'd feature usability and accessibility issues when used without care.
  • Ensure that CSS-only Icon component can also handle these pre-defined sizes via modifier classes and/or LESS mixin parameters (@AnneT I'll defer to you here)

Event Timeline

bmartinezcalvo renamed this task from Add icon and size props in the Link component to Add icon props to the Link component.Nov 8 2022, 1:46 PM
bmartinezcalvo updated the task description. (Show Details)

The real-world use case of start icons for Links is not clarified. Without guidelines when to use them (in contrast to f.e. quiet buttons).
For this reason I'd suggest to put this functionality on the backlog until we have clear need identified and guidance around it formed.

egardner renamed this task from Add icon props to the Link component to Enable Icon components to support pre-defined sizes.Nov 9 2022, 6:59 PM
egardner updated the task description. (Show Details)

I've updated this task to make it a little more reflective of what will actually need to be done.

We've got an updated icon size in some components design specs and implementation already with 16px equivalent. See T306135: Evaluate and settle on end indicator size (12px/16px/20px)

ldelench_wmf moved this task from Inbox to Backlog on the Design-System-Team board.

Updating to low priority to match the priority of its parent, T309248. Feel free to update!

egardner raised the priority of this task from Low to Medium.
Restricted Application raised the priority of this task from Medium to High. · View Herald TranscriptJan 26 2023, 10:40 PM
egardner changed the task status from Open to In Progress.Jan 26 2023, 10:40 PM

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

[design/codex@main] [WIP] Icon: support pre-defined Icon sizes

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

Change 884129 merged by jenkins-bot:

[design/codex@main] Icon: support pre-defined Icon sizes

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

egardner set the point value for this task to 3.Feb 8 2023, 5:22 PM

Design sign-off done. It LGTM.

@egardner just one thing to improve the demo. Could we include the different sizes as properties in the configurable demo?

Design sign-off done. It LGTM.

@egardner just one thing to improve the demo. Could we include the different sizes as properties in the configurable demo?

Per @Volker_E's comment, I think we can handle the introduction of a configurable demo for the Icon component in T321891: Add configurable demo for all Codex components.

If design sign-off is complete, I'm not sure that we need to QA anything here. I think this task can be moved to "pending release", as this change will be included in the next Codex release that we publish.

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

[mediawiki/core@master] Update Codex from v0.5.0 to v0.6.0

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

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

Change 889230 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v0.5.0 to v0.6.0

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

Volker_E claimed this task.

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

https://patchdemo.wmflabs.org/wikis/66d018802f/w/