Skip to content

Commit

Permalink
Improve modal sidebar on mobile.
Browse files Browse the repository at this point in the history
This fixes scroll bleed when post settings is open on mobile. It also fixes the vertical position of it.

The downside here is that you lose your place in the editor when you open modal. This is similar behavior to WordPress.com, and it's an improvement on the old editor where you'd have to scroll to the metaboxes below the editor regardless. But it might be worth looking into fixing this with JS down the road.
  • Loading branch information
jasmussen committed Jun 9, 2017
1 parent 8c1147c commit 6991910
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions editor/sidebar/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.editor-sidebar {
position: fixed;
position: sticky;
z-index: z-index( '.editor-sidebar' );
right: 0;
top: $admin-bar-height-big + $header-height;
Expand All @@ -8,6 +8,10 @@
border-left: 1px solid $light-gray-500;
background: $light-gray-300;

@include break-small() {
position: fixed;
}

@include break-medium() {
top: $admin-bar-height + $header-height;
}
Expand All @@ -28,7 +32,27 @@

/* Visual and Text editor both */
.editor-layout.is-sidebar-opened .editor-layout__content {
margin-right: $sidebar-width;
margin-left: -200%;
float: left;
height: 0;

@include break-small() {
margin-left: auto;
float: none;
height: auto;
}

@include break-medium() {
margin-right: $sidebar-width;
}
}

.editor-layout.is-sidebar-opened {
overflow: hidden;

@include break-small() {
overflow: auto;
}
}

.editor-layout.is-sidebar-opened .editor-sidebar {
Expand Down

0 comments on commit 6991910

Please sign in to comment.