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. |
| position: relative; | ||
| display: flex; | ||
| justify-content: flex-end; | ||
| z-index: 2; |
There was a problem hiding this comment.
Should we use the z-index mixin?
| flex-grow: 1; | ||
| flex-direction: column; | ||
| overflow-y: auto; | ||
| border-top: $border-width solid $gray-300; |
There was a problem hiding this comment.
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.
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.
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
onClosefor 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