-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
CustomSelectControl: Use __unstableSize
prop in Typography panel
#36162
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
|
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 Add
__unstable-large
size variant onInputControl
SelectControl
UnitControl
#35646, we introduced one more possible value for thesize
prop, namely__unstable-large
- in this PR, we're introducing a new prop called
__unstableSize
onCustomSelectControl
andFontSizePicker
I'm still unsure about the variant name large. Would a more descriptive name like
sidebar-default
org2-default
be 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-large
prop - the new
__unstableSize
prop onCustomSelectControl
andFontSizePicker
We should also add a CHANGELOG entry for the changes specific to this PR
@@ -55,6 +55,7 @@ const stateReducer = ( | |||
}; | |||
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?
@@ -28,6 +28,7 @@ import { | |||
|
|||
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)
@@ -6,6 +6,12 @@ import CustomSelectControl from '../'; | |||
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
FontSizePicker
andFontAppearanceControl
to the new 40px height. The height change is accomplished via a new internal__unstableSize
prop onCustomSelectControl
, which is the underlying component being used.FontSizePicker
(@wordpress/components
component) — Because this is an already stable component, the size is enlarged only in these limited contexts:FontAppearanceControl
(@wordpress/block-editor
component, 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
unstable
until 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-default
org2-default
be 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.js
files for terms that need renaming or removal).