Skip to content

Commit

Permalink
Fix centering
Browse files Browse the repository at this point in the history
This fixes an issue where an un-resized but still not full-width image wouldn't center in the editor.

It also removes some CSS bleed for some alignment styles that were specific to the Classic block, but weren't necessary for Gutenblocks. This fixes #4968.
  • Loading branch information
Joen Asmussen committed Feb 9, 2018
1 parent a451ffb commit 908f933
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
16 changes: 16 additions & 0 deletions blocks/library/freeform/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,22 @@
&:focus code[data-mce-selected] {
background: $light-gray-400;
}

.alignright {
float: right;
margin: 0.5em 0 0.5em 1em;
}

.alignleft {
float: left;
margin: 0.5em 1em 0.5em 0;
}

.aligncenter {
display: block;
margin-left: auto;
margin-right: auto;
}
}

// freeform toolbar
Expand Down
13 changes: 10 additions & 3 deletions blocks/library/image/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,14 @@
}
}

.editor-block-list__block[data-type="core/image"][data-align="center"] .wp-block-image {
margin-left: auto;
margin-right: auto;
.editor-block-list__block[data-type="core/image"][data-align="center"] {
.wp-block-image {
margin-left: auto;
margin-right: auto;
}

&[data-resized="false"] .wp-block-image div {
margin-left: auto;
margin-right: auto;
}
}
16 changes: 0 additions & 16 deletions edit-post/assets/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,6 @@ body.gutenberg-editor-page {
.components-navigate-regions {
height: 100%;
}

.alignright {
float: right;
margin: 0.5em 0 0.5em 1em;
}

.alignleft {
float: left;
margin: 0.5em 1em 0.5em 0;
}

.aligncenter {
display: block;
margin-left: auto;
margin-right: auto;
}
}

.editor-post-title,
Expand Down

0 comments on commit 908f933

Please sign in to comment.