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

Tabs: Vertical Tabs should be 40px min height #63446

Merged
merged 3 commits into from
Jul 15, 2024
Merged

Tabs: Vertical Tabs should be 40px min height #63446

merged 3 commits into from
Jul 15, 2024

Conversation

scruffian
Copy link
Contributor

@scruffian scruffian commented Jul 11, 2024

What?

Vertical tabs should be 40px min-height.

Why?

We don't need as much spacing for vertical tabs.

How?

Apply min-height: 40px to tabs which have a [aria-orientation='vertical'] attribute.

Screenshots or screencast

Before After
Screenshot 2024-07-11 at 16 31 26 Screenshot 2024-07-11 at 16 30 07

@scruffian scruffian added [Type] Bug An existing feature does not function as intended [Feature] Inserter The main way to insert blocks using the + button in the editing interface labels Jul 11, 2024
@scruffian scruffian self-assigned this Jul 11, 2024
@scruffian scruffian requested a review from ajitbohra as a code owner July 11, 2024 15:32
Copy link

github-actions bot commented Jul 11, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: scruffian <scruffian@git.wordpress.org>
Co-authored-by: jeryj <jeryj@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: richtabor <richtabor@git.wordpress.org>
Co-authored-by: DaniGuardiola <daniguardiola@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Contributor

@jeryj jeryj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like the right place to fix this 👍🏻

Comment on lines +124 to +128
[aria-orientation='vertical'] & {
min-height: ${ space(
10
) }; // Avoid fixed height to allow for long strings that go in multiple lines.
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we wrap this in a media query? For touch devices the larger 48px click area is helpful.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For touch devices the larger 48px click area is helpful.

FWIW, the 40px size (the new default height for basic control components) was chosen specifically to be touch-friendly, so I don't think we need to upsize on touch devices.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a breakpoint. Unfortunately we can't use the mixin in typescript.

@tyxla tyxla requested a review from a team July 11, 2024 16:22
@mirka
Copy link
Member

mirka commented Jul 11, 2024

We don't need as much spacing for vertical tabs.

Are we sure that makes sense in the general case? No strong opinion, but just wanted to make sure this decision wasn't colored too much by the patterns inserter case, where there happen to be a ton of tabs, and they are "secondary" to the horizontal tabs on top. (Or, it could mean that we can downsize the horizontal tabs to 40px as well.)

@richtabor
Copy link
Member

Are we sure that makes sense in the general case?

Yes, I would think so. It's more about the target area and not the space between the words that you see. 40px is the standard large size that we should use in most cases. Horizontal tabs are fine as-is.

Copy link
Member

@richtabor richtabor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Before After
CleanShot 2024-07-11 at 15 18 44 CleanShot 2024-07-11 at 15 19 06

@DaniGuardiola
Copy link
Contributor

As I was looking through different instances of Tabs, I realized we have many divergences with custom styles. This was one of them, so I'd like to do a full pass and make sure we can minimize those divergences across instances.

I might follow up with a PR that removes pretty much all custom styles so we can visualize it and make decisions about what styles/variants need to make it into the base component, or remain as a custom style.

@tyxla
Copy link
Member

tyxla commented Jul 12, 2024

As I was looking through different instances of Tabs, I realized we have many divergences with custom styles. This was one of them, so I'd like to do a full pass and make sure we can minimize those divergences across instances.

I might follow up with a PR that removes pretty much all custom styles so we can visualize it and make decisions about what styles/variants need to make it into the base component, or remain as a custom style.

I second this. Ideally, we should try to generalize any solutions and have as few style overrides as possible. This will make maintenance easier and will ensure we're more consistent across the entire editor.

@scruffian scruffian enabled auto-merge (squash) July 12, 2024 09:44
@ciampo
Copy link
Contributor

ciampo commented Jul 12, 2024

Absolutely. When a different design from what the source component offers is needed, we should fall into one of these two buckets:

  • if possible, we try to use what the component offers already without any overrides
  • if we really, really think that the new design / behavior is needed, than we should find the bet way to add it to the source component, without any overrides.

Keeping this mindset may cause slower pace of iteration, but it's immensely beneficial in the long term, both in terms of speed of iteration and consistency across the whole ecosystem.

@richtabor
Copy link
Member

@ciampo is this clear to merge?

@ciampo
Copy link
Contributor

ciampo commented Jul 15, 2024

@ciampo is this clear to merge?

I initially shared the same doubts as Lena, but if there's agreement that this change makes sense in the general case we can go ahead after adding a CHANGELOG entry (it can go under Internal since Tabs is still a private component) 🚀

As a follow-up, I would also strongly recommend that we do a pass of all Tabs instances and remove as many style overrides as possible (ideally all of them) as @DaniGuardiola suggested. Style divergences are a symptom that our designs are inconsistent and/or that the source component is not offering what consumers need, and we should fix it — especially since we'd like to stabilize Tabs very soon.

@scruffian scruffian requested a review from ndiego as a code owner July 15, 2024 10:15
@scruffian scruffian merged commit abed060 into trunk Jul 15, 2024
61 checks passed
@scruffian scruffian deleted the fix/63440 branch July 15, 2024 10:51
@github-actions github-actions bot added this to the Gutenberg 18.9 milestone Jul 15, 2024
carstingaxion pushed a commit to carstingaxion/gutenberg that referenced this pull request Jul 18, 2024
* Inserter: Reduce the height of the categories tabs to 40px

* Make all vertically oriented tabs have a min height of 40px
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Type] Bug An existing feature does not function as intended
Projects
Development

Successfully merging this pull request may close these issues.

7 participants