Closed Bug 1885332 Opened 11 months ago Closed 29 days ago

Add a README with documentation for moz-button

Categories

(Toolkit :: UI Widgets, task)

task

Tracking

()

RESOLVED FIXED
136 Branch
Tracking Status
firefox136 --- fixed

People

(Reporter: hjones, Assigned: akulyk)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [recomp])

Attachments

(1 file)

We should add some component specific documentation for moz-button. In particular we should highlight the different button types and give examples of how to style <moz-button type="icon">.

Blocks: moz-button
Duplicate of this bug: 1860091

Some interesting points that have come up recently and might be good to document:

  • When to use the different variants (destructive vs primary, etc)
  • Basic tone guidelines for the different variants
  • Avoiding changing button types on interaction (i.e. switching from primary to destructive on hover)
  • Avoiding "Schrodinger's button" i.e. buttons that only appear when you hover something

There is already content on some of this on the Acorn site, but it could be nice to have some basic developer facing documentation on this as well.

Duplicate of this bug: 1873219

Another thing that came up today which we should really document - there are two ways of providing an icon/image to moz-button you can either specify type="icon":

<moz-button type="icon"></moz-button>

and provide a background-image for the ::part:

moz-button::part(button) {
  background-image: url("chrome://global/skin/media/audio-muted.svg");
}

Or you can provide an icon URI via iconsrc, in which case setting type="icon" is redundant:

<moz-button iconsrc="chrome://global/skin/media/audio-muted.svg"></moz-button>

We should probably update the Storybook link used in the Usage section of the Acorn site as well. Right now it has an incorrect link.

Assignee: nobody → akulyk
Pushed by hjones@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1d1638d009de Add a README with documentation for moz-button r=reusable-components-reviewers,hjones
Status: NEW → RESOLVED
Closed: 29 days ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: