vanilla-framework icon indicating copy to clipboard operation
vanilla-framework copied to clipboard

Text in buttons shouldn't be centered

Open lyubomir-popov opened this issue 1 year ago • 7 comments

Component/pattern to amend

When placed in narrow containers, this happens: image

Visual

Provide a screenshot or link to a prototype of your pattern amendment.

Context

In what context does your amendment solve a problem?

lyubomir-popov avatar Jan 18 '24 16:01 lyubomir-popov

WG: @lyubomir-popov provide solution for this case.

When does this actually happen? Provide examples. The expected behaviour should be that the button becomes as long as the text, unless something is limiting it.

danielmutis avatar Jan 24 '24 10:01 danielmutis

I think he means on this page

Screenshot 2024-02-16 at 19 11 58

carkod avatar Feb 16 '24 18:02 carkod

WG:

  • If the text wraps the label should be left aligned
  • We need to have a guideline that strongly advises against long labels on buttons

danielmutis avatar May 29 '24 09:05 danielmutis

Some thoughts:

  1. There is no consistent way to predict if text will wrap using HTML/CSS, so any form of logic based on this condition is not plausible
  2. It would be quite unusual for a button with multiple lines of text to have the text left-aligned - I have rarely seen this pattern, presumably because it looks odd

I would recommend leaving the existing button styles as-is and providing more thorough guidance on maximum lengths of button text in our documentation.

pastelcyborg avatar Jul 30 '24 22:07 pastelcyborg

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/WD-13784.

This message was autogenerated

@danielmutis Do you recall what was the decision/comment from WG last week? How do we want to address it?

bartaz avatar Sep 24 '24 09:09 bartaz

  • We want to strongly advice against long text in buttons. We might limit the amount of characters that can be used on a button to avoid this.
  • If there was no other choice, the text would be aligned left.
  • This may be related to the buttons on the SSO project, which are wider than the content, so the content remains left-aligned.

CleanShot 2024-09-26 at 16 31 21

danielmutis avatar Sep 27 '24 08:09 danielmutis