Theme: Add dimension tokens for control height#75101
Conversation
Co-authored-by: Marco Ciampini <[email protected]>
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
Size Change: +1.09 kB (+0.04%) Total Size: 3 MB
ℹ️ View Unchanged
|
|
Curious the overlap between something like this and #73429 , where we may want consistency of "dropdown item" heights like menus, select dropdown options, etc. |
|
Height arguably has application beyond controls; menu items, toolbars, chips, images (avatars), tabs. So I wonder if this should be a broader more generic scale? I'm also curious how checkboxes and radios fit in. They're controls, but not covered by proposed the scale currently. Should they be? This may also hint towards a larger scale. The density picture still isn't super clear to me which makes it difficult to comment on the interaction between |
I think one of the takeaways for me here was in how we want to guarantee vertical alignment between adjacent controls. Does that extend to checkboxes and radios as well? (And is that the same as every other control, i.e. fitting within the existing set)
Yeah one thing which occurs to me now after letting it sit for the weekend is that while there's precedent with the "small" and "compact" naming variants here, it doesn't do us any favors in how it overlaps with the "compact" density. Especially confusing is the |
|
Generally I think things like radios and checkboxes should occupy a 'full row' as they don't align naturally with other controls along the X axis. |
faa61fc to
7cc36bb
Compare
|
Re. component variants vs theme-wide density settings: for me the main difference is that theme-wide density would affect all UI in that "region", while component-level obviously only affects the single component. Which is why it makes sense to me that we have a "small" or "compact" button, because it will always look "smaller" than other default-sized controls, regardless of the theme-wise density settings. Although I agree that naming is hard, and we may want to greate a dictionary of words to be used for those aspects, so that they don't get confusing. Re tokens in this PR, my gut feeling is that we may want more generic "size" tokens, to be applied to UI sizing in general |
What?
Builds on: #75054
Related discussion: #74652 (comment)
Adds new
control-heightdimension tokens and updatesButtonto use them.Why?
Right now, this is exploratory, seeking to:
control-height.Input, and perhaps later expanded to incorporate other common control aspects like inline padding, gaps, and icon size.This doesn't completely answer the question about the relation between component-specific sizing properties like
Button'ssize=compactorTab'sdensity/variant, but it does provide a path for them to work together:sizeallow absolute control over the role that component plays (e.g. toggle buttons are inherently compact)Testing Instructions
Review Button stories, particularly the "Compact" and "Default" buttons in combination with "Compact" or "Comfortable" theme density.