dequelabs / dequelabs/cauldron

Allow buttons to be inline or stacked depending on the screen size

Open
#811 1 comment 0 reactions 0 assignees View on GitHub
enhancement ux debt
Dominant language
TypeScript
Stars
127
Forks
31
Avg merge
2d 12h
Merged PRs (30d)
8

Description

The CSS below for [adding margin-left to the second button](https://github.com/dequelabs/cauldron/blob/develop/packages/styles/button.css#L193-L195) doesn't look good on smaller screens since the second button is not left aligned with the first button.

> as a general rule buttons should have spacing applied and it should be up to the content author to determine when that’s not needed. - @scurker

```
[class*='Button--'] + [class*='Button--'] {
margin-left: var(--space-smallest);
}
```

Example from Cauldron docs:
Screen Shot 2022-10-14 at 1 34 53 PM

[Discussion from Deque Slack](https://deque.slack.com/archives/C5MUFQ7UM/p1665776153371979)

## Potential Solutions
- From @schne324: Create a basic wrapper for having inline buttons with margins. Take the margins off the buttons and use the wrapper to declare the margins.
``
> Using grid or flex it'd be easy to make the buttons look good inline as well as when they wrap to one button per "row"

- From @bobbyomari:
> There's probably a discussion about when stacked buttons should be full width vs "normal" and the ability to turn that on/off depending on the use case

![image (1)](https://user-images.githubusercontent.com/3081483/197814987-c89bd9ab-2321-45ef-a6b3-55e2c155f44f.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.