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

Try mobile toolbar below the block #6347

Merged
merged 1 commit into from
May 16, 2018
Merged
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
1 change: 1 addition & 0 deletions edit-post/assets/stylesheets/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ $admin-sidebar-width-collapsed: 36px;
// Visuals
$shadow-popover: 0 3px 20px rgba( $dark-gray-900, .1 ), 0 1px 3px rgba( $dark-gray-900, .1 );
$shadow-toolbar: 0 2px 10px rgba( $dark-gray-900, .1 ), 0 0 2px rgba( $dark-gray-900, .1 );
$shadow-below-only: 0 5px 10px rgba( $dark-gray-900, .1 ), 0 2px 2px rgba( $dark-gray-900, .1 );

// Editor Widths
$sidebar-width: 280px;
Expand Down
29 changes: 20 additions & 9 deletions editor/components/block-list/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -603,16 +603,33 @@

.editor-block-contextual-toolbar,
.editor-block-list__breadcrumb {
position: sticky;
z-index: z-index( '.editor-block-contextual-toolbar' );
white-space: nowrap;
text-align: left;
pointer-events: none;
height: $block-toolbar-height;

// Position toolbar below the block on mobile
position: absolute;
bottom: -$block-toolbar-height + 1px;
left: $block-padding;
right: $block-padding;
box-shadow: $shadow-below-only;

// Position the contextual toolbar above the block, add 1px to each to stack borders
margin-top: -$block-toolbar-height - 1px;
margin-bottom: $block-padding + 1px;
@include break-mobile() {
position: sticky;
bottom: auto;
left: auto;
right: auto;
box-shadow: none;
margin-top: -$block-toolbar-height - 1px;
margin-bottom: $block-padding + 1px;
}

@include break-small() {
top: -1px; // stack borders
}

// Floated items have special needs for the contextual toolbar position
.editor-block-list__block[data-align="left"] &,
Expand All @@ -637,12 +654,6 @@
}
}

// on mobile, toolbars fix differently
top: $header-height - 1px; // stack borders
@include break-small() {
top: -1px; // stack borders
}

// Reset pointer-events on children.
& > * {
pointer-events: auto;
Expand Down