Skip to content

Update buttons to accept an optional icon #893

@craigcook

Description

@craigcook

Sometimes we want to put an icon on a button, to make it distinct from other buttons or indicate a specific function. For example, a download button might include a little down arrow icon like: image

A few approaches we might take:

  1. Update button styling to accommodate an inline image, so we could include icons arbitrarily (maybe wrapped in a span, might need a modifier class on the button).
  2. Predefine a few specific kinds of icon buttons for specific purposes, then a theme class could handle the icon in CSS (a pseudo-element with a background).

Additional thoughts:

  • We might need style alternatives for icon-on-left or icon-on-right, unless we decide to commit to only one.
  • Icon position should respect language direction.
  • We probably shouldn't allow doubling icons (no left AND right). Unless there's a very good use case for two icons in a button?
  • If we use Protocol icon assets we'll need them in both dark and light (though if it's an inline SVG we could color the icon with CSS)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions