Skip to content
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

[Widgets] Fix toolbar not fixed to top and not horizontally scrollable. #25640

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
// Disable the lint rule since the id has "_" in it, and this is the only way to select it.
// stylelint-disable selector-id-pattern
#customize-theme-controls #sub-accordion-section-gutenberg_widget_blocks.open {
// To make position: sticky work, we have to provide a fixed height to the overflow parent.
height: 100%;
}

.edit-widgets-customizer-edit-widgets-initializer__content {
position: relative;

.edit-widgets-header-container {
position: sticky;
// customize-pane-child has a 12px padding.
top: -12px;
// The blue outline for active blocks has z-index of 1, we want to be greater than that.
z-index: 2;
}

.edit-widgets-header {
margin-top: -16px;
border-top: 1px solid $gray-300;
Expand All @@ -10,6 +26,12 @@
background: #fff;
margin-left: -12px;
margin-right: -12px;

.block-editor-block-toolbar {
// Use auto instead of scroll so that it won't show the scroll bar if it doesn't have to.
overflow-x: auto;
overflow-y: hidden;
}
}
.edit-widgets-sidebar {
margin-left: -12px;
Expand Down
4 changes: 2 additions & 2 deletions packages/edit-widgets/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function Header( { isCustomizer } ) {
const rootClientId = useLastSelectedRootId();

return (
<>
<div className="edit-widgets-header-container">
<div className="edit-widgets-header">
<NavigableToolbar
className="edit-widgets-header-toolbar"
Expand Down Expand Up @@ -71,7 +71,7 @@ function Header( { isCustomizer } ) {
<BlockToolbar hideDragHandle />
</div>
) }
</>
</div>
);
}

Expand Down