Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toggle-button-group: add equal heights and make fully responsive #2310

Open
6 tasks done
ArtBlue opened this issue Apr 10, 2024 · 3 comments
Open
6 tasks done

toggle-button-group: add equal heights and make fully responsive #2310

ArtBlue opened this issue Apr 10, 2024 · 3 comments

Comments

@ArtBlue
Copy link
Contributor

ArtBlue commented Apr 10, 2024

Description

Currently, our toggle-buttons within a toggle-button-group do not have the same height so when the content of one button is taller than others, the layout is not balanced.

Additionally, the initial iteration of toggle-button-group was semi-responsive with the use of 'desired columns` for the preferred number of buttons per row before wrapping, which was not guaranteed.

Since these two features are extremely intertwined because of a shift to use display: grid and both require a breaking change, it's best to do them at the same time.

For this issue,

  1. Add equal heights feature to toggle-button-group so that an increase in height of one button makes all buttons the same height, whether they are on a single row or span multiple rows.
  2. Make toggle-button-group fully responsive using container queries.

Screenshots

Current:

image

Desired:

image

Figma link

No response

Engineering pre-requisites

  • Successful design review with Design System Team.
  • Supports dark mode.
  • Supports responsive design.
  • Tokens have been provided (or already exist).
  • Successful accessibility review with Core A11Y Team.
  • Successful frontend review with eBayUI Team.
@ArtBlue ArtBlue self-assigned this Apr 10, 2024
@ArtBlue
Copy link
Contributor Author

ArtBlue commented Apr 10, 2024

Dev Note

Most likely, we'll have to start using flex for toggle-button-group, which will be a slight abandoning of inline-block, which allows more easy wrapping. The solution might need to make clever use of flex on the <li>s, something like,

/* width percentages relative to 100% / [columns] */
/* subtracting the margins from both sides */
flex: 1 0 calc(33% -(var(--spacing-50)* 2));

@agliga agliga added this to the 17.5.0 milestone Apr 22, 2024
@ArtBlue
Copy link
Contributor Author

ArtBlue commented May 13, 2024

Dev Note

Most likely, we'll have to start using flex for toggle-button-group, which will be a slight abandoning of inline-block, which allows more easy wrapping. The solution might need to make clever use of flex on the <li>s, something like,

/* width percentages relative to 100% / [columns] */
/* subtracting the margins from both sides */
flex: 1 0 calc(33% -(var(--spacing-50)* 2));

This option only allowed equal heights across a single row. Once the row wraps, heights are reset. This means that each row can have a different height.

@agliga agliga modified the milestones: 17.5.0, 18.0.0 May 15, 2024
@ArtBlue ArtBlue changed the title toggle-button-group: add equal heights to toggle buttons in group toggle-button-group: add equal heights and make fully responsive May 21, 2024
@ArtBlue
Copy link
Contributor Author

ArtBlue commented May 21, 2024

Note on direction: the only way to have equal height buttons spanning multiple rows is to use display: grid with column templates and implied rows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants