-
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
ToggleGroupControl: add new opt-in prop #47269
Conversation
Size Change: -2 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Flaky tests detected in be948e2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4049480293
|
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.
Perfect, thank you!
@@ -598,6 +598,7 @@ function Navigation( { | |||
) } | |||
<h3>{ __( 'Overlay Menu' ) }</h3> |
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.
I wonder what this h3
with the wonky margin is doing here 😭
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.
😬 Maybe not in this PR since it cascades into more than just a line change, but would it make sense to remove the prop hideLabelFromVision
from the ToggleGroupControl
and remove the h3? I wonder why we need to hide 'Configure', and if we do, why does it need to be in the label as well? 🤔 Does it add much value in terms of accessibility?
And another h3 is added for 'Submenus'. Would it make sense to use BaseControl.VisualLabel
above the ToggleControl
components? Or is there something else we'd use for just labels?
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.
would it make sense to remove the prop
hideLabelFromVision
from theToggleGroupControl
and remove the h3?
I think so! In this case I think it's actually suboptimal for screen reader users since the h3
and aria-label
texts are so redundant.
And another h3 is added for 'Submenus'. Would it make sense to use
BaseControl.VisualLabel
above theToggleControl
components?
Sounds good to me. BaseControl.VisualLabel
is fair game whenever you want something that always looks like the other control labels but is not semantically a control label. It is safer than relying on implicit cascading styles like we have here on all h3
s in the sidebar 😅
3315566
to
be948e2
Compare
What?
Adding new opt-in prop
__nextHasNoMarginBottom
to usages ofToggleGroupControl
in the Gutenberg codebase.Why?
Part of this project: #38730
The tl;dr is
BaseControl
has amargin-bottom
which makes it difficult to reuse and results in inconsistent use.How?
By adding the prop
__nextHasNoMarginBottom
.Additional Notes
Testing Instructions
Test in Block Editor:
SCALE_OPTIONS (dimension controls)
Test in Block Editor or Site Editor:
ChildLayoutEdit
DefaultLayoutInspectorControls
FlexLayoutJustifyContentControl & OverlayMenuPreview & stylingInspectorControls
--- Begin - Arrow changes ---
The following three components/blocks have the same change in spacing as described above:
PostNavigationLinkEdit
QueryPaginationArrowControls
Test in Site Editor:
CommentsPaginationArrowControls
--- End Arrow changes ---
ScreenHeadingColor
Test in Storybook:
ToggleGroupControl
ToolsPanel
ToolsPanel won't look visually different, but the changes are for
default
,With Conditional Default Control
, andWith Conditionally Rendered Control
.