-
Notifications
You must be signed in to change notification settings - Fork 4.7k
CustomSelectControl: Use __unstableSize prop in Typography panel
#36162
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
Conversation
Because this component is marked as experimental, I think we can default it to large.
|
Size Change: +145 B (0%) Total Size: 1.08 MB
ℹ️ View Unchanged
|
aaronrobertshaw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @mirka ✨
Everything tests as advertised for me.
✅ FontSizePicker displays at appropriate size in both block and site editors
✅ FontAppearanceControl displays correctly in both editors as well
✅ Storybook updates for CustomSelectControl and TypographyPanel test well also
LGTM 👍
|
Thank you for the reviews!
@jasmussen Absolutely, Although I've been told that some inconsistency is expected while we transition to the new designs, I'm with you in that I want to minimize that inconsistency as much as reasonably possible. Would you prefer that we hold off merging these until the |
No no, if we have some confidence that we can land those other changes in somewhat quick order, totally fine (and good) to do it bit by bit. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as a recap (mainly for myself, to avoid confusion):
- in #35646, we introduced one more possible value for the
sizeprop, namely__unstable-large - in this PR, we're introducing a new prop called
__unstableSizeonCustomSelectControlandFontSizePicker
I'm still unsure about the variant name large. Would a more descriptive name like
sidebar-defaultorg2-defaultbe more intuitive, given the intent? Let me know what you think.
Not sure about that. We'd need to understand if we should aim at providing more standardised values for the size prop across the library (eg default, small, large), or if we want to offer more "custom" values depending on the component. Regardless, I would avoid mentioning the g2 term, as it refers to a project that ran alongside the gutenberg repo, and it could lead to more confusion for some folks.
I wonder if we should document in the respective components READMEs:
- the new
__unstable-largeprop - the new
__unstableSizeprop onCustomSelectControlandFontSizePicker
We should also add a CHANGELOG entry for the changes specific to this PR
| }; | ||
| export default function CustomSelectControl( { | ||
| className, | ||
| __unstableSize, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this have a default value of default, as suggested by the options defined in the Storybook example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, in order to align values used across components, should we also consider allowing a value of small for this prop?
|
|
||
| function FontSizePicker( | ||
| { | ||
| __unstableSize, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this also have a default value of default? Maybe this is fine to leave as undefined, since a default value will be potentially given by CustomSelectControl (see earlier comment)
| export default { | ||
| title: 'Components/CustomSelectControl', | ||
| component: CustomSelectControl, | ||
| argTypes: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Controls FTW !
|
Closing in favor of the approach taken in #42718 |



Part of #36230
⏳ On hold until coordinated merge with other related PRs
Description
This PR enlarges
FontSizePickerandFontAppearanceControlto the new 40px height. The height change is accomplished via a new internal__unstableSizeprop onCustomSelectControl, which is the underlying component being used.FontSizePicker(@wordpress/componentscomponent) — Because this is an already stable component, the size is enlarged only in these limited contexts:FontAppearanceControl(@wordpress/block-editorcomponent, experimental) — Because this block is still experimental and can be expected to only appear in the Typography panels, the size is enlarged by default.Background
After some talks with @jasmussen @pablohoneyhoney @griffbrad, the overall sentiment was that we weren't ready to officially commit to a new set of size variants, especially for non-experimental components (which were designed pre-G2 and are widely used in contexts other than the sidebar). For non-experimental components, it would be safer for us to keep the 40px size variant
unstableuntil we are confident to make it part of the official size variants.❓ Variant name
I'm still unsure about the variant name
large. Would a more descriptive name likesidebar-defaultorg2-defaultbe more intuitive, given the intent? Let me know what you think.How has this been tested?
Types of changes
New feature (non-breaking change which adds functionality)
TODO before merge
Checklist:
*.native.jsfiles for terms that need renaming or removal).