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

Button: uniform text wrapping across variants #66049

Open
2 tasks
ciampo opened this issue Oct 11, 2024 · 7 comments
Open
2 tasks

Button: uniform text wrapping across variants #66049

ciampo opened this issue Oct 11, 2024 · 7 comments
Assignees
Labels
Needs Dev Note Requires a developer note for a major WordPress release cycle [Package] Components /packages/components [Status] In Progress Tracking issues with work in progress

Comments

@ciampo
Copy link
Contributor

ciampo commented Oct 11, 2024

It would be interesting to understand why the default button doesn't use white-space: nowrap while the primary, secondary, and tertiary variants do. I do understand the link variant should allow text to wrap, but why the default does? GIF to illustrate:
Cc @WordPress/gutenberg-components

Image

Originally posted by @afercia in #65491 (comment)

Follow-ups

@ciampo
Copy link
Contributor Author

ciampo commented Oct 11, 2024

Moving the above conversation to a separate issue. We'd have to probably look into when the white-space: nowrap style was added to understand more about the need for such feature.

In theory we should be able to support such wrapping in the default button too, although as always when Button is involved, the implications of a small change can still be numerous.

@WordPress/gutenberg-design , can you think of a reason why we should not do this, at least in principle?

@jasmussen
Copy link
Contributor

jasmussen commented Oct 11, 2024

I sometimes use GitHub Lens to find context for a particular line of code. In this case, it takes me to #19058, which just suggests to me that it's a missing beat.

Edit: I see it was only added to .is-button though, and not added to .is-default, which may just be something that was missed.

@afercia
Copy link
Contributor

afercia commented Oct 11, 2024

I think white-space: nowrap was originally added in #6562 to avoid the component to rely on styles provided by Core. In fact, the Core buttons do use white-space: nowrap.

@tyxla
Copy link
Member

tyxla commented Oct 11, 2024

In theory we should be able to support such wrapping in the default button too, although as always when Button is involved, the implications of a small change can still be numerous.

This. This could actually be considered a potentially breaking change.

@ciampo
Copy link
Contributor Author

ciampo commented Oct 11, 2024

This could actually be considered a potentially breaking change.

Potentially, although we could apply the change at the start of a release process, giving folks ample time to test their UIs, and add a dev note about it too. Also, in a way this could be seen as a bug fix — we could argue that the Button component was always meant to have white-space: nowrap and that it was just missed on the default variant.

@ciampo ciampo added the [Package] Components /packages/components label Oct 11, 2024
@tyxla
Copy link
Member

tyxla commented Oct 11, 2024

This could actually be considered a potentially breaking change.

Potentially, although we could apply the change at the start of a release process, giving folks ample time to test their UIs, and add a dev note about it too. Also, in a way this could be seen as a bug fix — we could argue that the Button component was always meant to have white-space: nowrap and that it was just missed on the default variant.

I wouldn't be opposed to that 👍

@ciampo ciampo added the Needs Dev Note Requires a developer note for a major WordPress release cycle label Oct 11, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Oct 11, 2024
@ciampo
Copy link
Contributor Author

ciampo commented Oct 11, 2024

Tentative PR: #66068

Let's test extensively to understand the potential for any visible regressions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Dev Note Requires a developer note for a major WordPress release cycle [Package] Components /packages/components [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants