-
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
Add visible close button to inserter sidebar #61426
Conversation
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
display: flex; | ||
justify-content: flex-end; | ||
z-index: 2; |
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 we use the z-index mixin?
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.
Done in 06e38fc
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 one!
@@ -135,6 +136,7 @@ $block-inserter-tabs-height: 44px; | |||
flex-grow: 1; | |||
flex-direction: column; | |||
overflow-y: auto; | |||
border-top: $border-width solid $gray-300; |
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.
Moves the border from the tablist to the content so it is still full width
className="editor-inserter-sidebar__close-button" | ||
icon={ closeSmall } | ||
label={ __( 'Close block inserter' ) } | ||
onClick={ () => setIsInserterOpened( false ) } | ||
size="small" |
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.
Match the list view button size
} | ||
|
||
.editor-inserter-sidebar__content { | ||
// Leave space for the close button | ||
height: calc(100% - #{$button-size} - #{$grid-unit-10}); |
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.
No longer necessary because the close button can sit next to the tabs rather than above them.
Size Change: -100 B (-0.01%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
This has some issues we should revert. |
Alternative to #61421 so we don't need to prop drill an
onClose
for the sidebar into the<InserterTabs />
What?
Add a close button to the inserter.
Why?
We'd like to leave the inserter always open, which means it needs a close button - see #60391.
How?
Absolutely positions the close button and reduces the width of the tablist to make room.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast