Skip to content

Commit

Permalink
Improve mobile a bit.
Browse files Browse the repository at this point in the history
Hide movers and config toolbars on the side.

These will be resurfaced as part of a separate effort in #705.
  • Loading branch information
jasmussen committed Jun 27, 2017
1 parent e4ba891 commit a97d419
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
7 changes: 7 additions & 0 deletions editor/block-mover/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
top: 10px;
left: 0;
padding: 0 14px 20px 0; // handles hover area

// Mobile, to be revisited
display: none;

@include break-small {
display: block;
}
}

.editor-block-mover__control {
Expand Down
7 changes: 7 additions & 0 deletions editor/block-settings-menu/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
position: absolute;
top: 10px;
right: 0;

// Mobile, to be revisited
display: none;

@include break-small {
display: block;
}
}

.editor-block-settings-menu__control {
Expand Down
34 changes: 25 additions & 9 deletions editor/modes/visual-editor/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,30 @@
margin-bottom: 5px;
max-width: $visual-editor-max-width + ( 2 * $block-mover-padding-visible );
position: relative;
// The block mover needs to stay inside the block to allow clicks when hovering the block
padding: $block-padding $block-padding + $block-mover-padding-visible;

padding: $block-padding;

@include break-small {
// The block mover needs to stay inside the block to allow clicks when hovering the block
padding: $block-padding $block-padding + $block-mover-padding-visible;
}

&:before {
z-index: z-index( '.editor-visual-editor__block:before' );
content: '';
position: absolute;
top: 0;
bottom: 0;
left: $block-mover-padding-visible;
right: $block-mover-padding-visible;
outline: 1px solid transparent;
transition: 0.2s outline;
top: 0;
bottom: 0;

left: 0;
right: 0;

@include break-small {
left: $block-mover-padding-visible;
right: $block-mover-padding-visible;
}
}

&.is-hovered:before {
Expand Down Expand Up @@ -211,14 +222,16 @@
z-index: z-index( '.editor-visual-editor__block-controls' );
margin-top: -$block-controls-height - $item-spacing;
margin-bottom: $item-spacing + 20px; // 20px is the offset from the bottom of the selected block where it stops sticking
height: $block-controls-height;
width: 0;
white-space: nowrap;

top: $header-height + $item-spacing;
// Mobile viewport
margin-left: -$block-padding;
margin-right: -$block-padding;

// Larger viewports
@include break-small() {
top: $header-height + $admin-bar-height-big + $item-spacing;
margin-left: 0;
}

@include break-medium() {
Expand All @@ -240,6 +253,7 @@ $sticky-bottom-offset: 20px;
.editor-visual-editor__block-controls .components-toolbar {
margin-right: -1px;

// Larger viewports
@include break-small() {
margin-right: $item-spacing;
}
Expand All @@ -250,6 +264,8 @@ $sticky-bottom-offset: 20px;
}

.editor-visual-editor .editor-inserter {
margin: $item-spacing;

@include break-small {
margin: $item-spacing $item-spacing $item-spacing calc( 50% - #{ $visual-editor-max-width / 2 } ); // account for full-width trick
}
Expand Down

0 comments on commit a97d419

Please sign in to comment.