Page MenuHomePhabricator

[Spike] What is the best way to mix icons and buttons mw-ui- classes for building the sticky header
Closed, ResolvedPublic3 Estimated Story PointsSpike

Description

In previous projects we've introduced design inconsistencies whenever we've mixed button and icon classes, specifically around hover states.

Question to answer:

  • Going into sticky header work what is the best way to create a button with an icon?

Outcome:

  • Sample code documented in this ticket.
  • Are there any changes we should make to core to get more optimal results

Sign off steps

Sample code will be added to the first sticky header tasks

Event Timeline

Restricted Application changed the subtype of this task from "Task" to "Spike". · View Herald TranscriptAug 23 2021, 5:10 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 715072 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] Add support for buttons with icons

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

After talking with @bwang the most obvious markup to use would be:

<div class="mw-ui-button">
		<span class="mw-ui-icon mw-ui-icon-wikimedia-search"></span>
		Button text
	</div>

Using WVUI as a reference:
https://doc.wikimedia.org/wvui/master/ui/?path=/story/components-button--all-combinations&args=icon:wvuiIconArticlesSearch

Change 715072 merged by jenkins-bot:

[mediawiki/core@master] mw-ui-button should be compatible with the checkbox hack

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

Change 716065 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] [storybook] Document button usage and update broken stories

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

Change 716065 merged by jenkins-bot:

[mediawiki/skins/Vector@master] [storybook] Document button usage and update broken stories

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

Should be signed off by someone other than Bernard or myself to help knowledge share the decisions made here.

lgtm - thanks for the button/icon refactor