Skip to content

Commit

Permalink
Polish Editor and Toolbar position in the different breakpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Oct 27, 2017
1 parent aa9c1ac commit 591e55e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
23 changes: 13 additions & 10 deletions editor/assets/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ body.gutenberg-editor-page {
#update-nag, .update-nag {
display: none;
}

#wpcontent {
padding-left: 0;
}

#wpbody-content {
padding-bottom: 0;
}

#wpfooter {
display: none;
}

.a11y-speak-region {
left: -1px;
top: -1px;
}

svg {
fill: currentColor;
}
Expand Down Expand Up @@ -54,23 +54,26 @@ body.gutenberg-editor-page {

.gutenberg__editor {
position: relative;
height: calc( 100vh - #{ $admin-bar-height-big } );
height: calc( 100vh - #{ $admin-bar-height-big} );
padding-top: $header-height + $stacked-toolbar-height;

// The WP header height changes at this breakpoint
@include break-medium {
height: calc( 100vh - #{ $admin-bar-height } );
}

// The block toolbar disappears at this breakpoint
@include break-large {
padding-top: $header-height;
}

img {
max-width: 100%;
}

iframe {
width: 100%;
}

@include break-small() {
padding-top: $header-height;
}
}

.editor-post-title,
Expand Down
24 changes: 17 additions & 7 deletions editor/header/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@
left: 0;
right: 0;

top: 0;
position: sticky;

@include break-small() {
top: $admin-bar-height-big;
position: fixed;
}
top: $admin-bar-height-big;
position: fixed;

@include break-medium() {
top: $admin-bar-height;
Expand Down Expand Up @@ -139,6 +134,17 @@
border-bottom: 1px solid $light-gray-500;
min-height: $stacked-toolbar-height;

.is-sidebar-opened & {
display: none;
}

@include break-medium {
.is-sidebar-opened & {
display: block;
right: $sidebar-width;
}
}

// merge toolbars after this breakpoint
@include break-large { // we should try and lower this breakpoint through an ellipsis overflow feature
padding-left: $item-spacing;
Expand All @@ -148,5 +154,9 @@
background: none;
border-bottom: none;
min-height: auto;

.is-sidebar-opened & {
right: auto;
}
}
}
5 changes: 0 additions & 5 deletions editor/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
.editor-layout__content {
display: flex;
flex-direction: column;
margin-top: #{ -1 * $header-height };

@include break-medium {
margin-top: 0;
}
}

.editor-layout__editor {
Expand Down
10 changes: 1 addition & 9 deletions editor/modes/visual-editor/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,14 @@
position: relative;
height: 100%;
margin: 0 auto;
padding: ( $stacked-toolbar-height + $admin-bar-height-big ) 0 0;
padding: 50px 0 0;

&,
& p {
font-family: $editor-font;
font-size: $editor-font-size;
line-height: $editor-line-height;
}

@include break-small() {
padding: ( $stacked-toolbar-height + $admin-bar-height-big ) 0 0;
}

@include break-large() {
padding: 60px 0;
}
}

.editor-visual-editor {
Expand Down

0 comments on commit 591e55e

Please sign in to comment.