Skip to content

Commit

Permalink
Restore floated image margins. (#21500)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmussen authored Apr 22, 2020
1 parent f8e4c9c commit f34d799
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/block-library/src/image/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
margin-top: -9px;
margin-left: -9px;
}

// These need specificity to override an inherited left/right block margin in the editor.
&.wp-block-image.alignleft {
margin-right: 1em;
margin-top: 0.5em;
margin-bottom: 0.5em;
}

&.wp-block-image.alignright {
margin-left: 1em;
margin-top: 0.5em;
margin-bottom: 0.5em;
}
}

// This is necessary for the editor resize handles to accurately work on a non-floated, non-resized, small image.
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/image/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,17 @@
float: left;
/*rtl:ignore*/
margin-right: 1em;
margin-top: 0.5em;
margin-bottom: 0.5em;
}

.alignright {
/*rtl:ignore*/
float: right;
/*rtl:ignore*/
margin-left: 1em;
margin-top: 0.5em;
margin-bottom: 0.5em;
}

.aligncenter {
Expand Down

0 comments on commit f34d799

Please sign in to comment.