Skip to content

Commit 3261f93

Browse files
committed
Remove full-width trick pending better one
This also adds a few improvements from the now deleted branch, #799, notably: - clearing for video blocks. The responsive trickery means we have to, or we will get odd behavior otherwise - better collapsing margins fix for the toolbar.
1 parent 4a89530 commit 3261f93

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

blocks/library/embed/style.scss

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.blocks-embed {
22
margin: 0;
3+
clear: both; // necessary because we use responsive trickery to set width/height, and therefore the video doesn't intrinsically clear floats like an img does
34
}
45

56
.blocks-embed .iframe-overlay {

editor/modes/visual-editor/style.scss

+6-11
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
}
1919
}
2020

21-
/* "Hassle-free full bleed" from CSS Tricks */
22-
.editor-visual-editor > *:not( [data-align="wide"] ) {
21+
.editor-visual-editor {
2322
max-width: $visual-editor-max-width;
2423
margin-left: auto;
2524
margin-right: auto;
@@ -87,16 +86,12 @@
8786
}
8887
}
8988

89+
$sticky-bottom-offset: 20px;
9090
.editor-visual-editor__block-controls + div {
91-
margin-top: -20px;
92-
93-
// prevent collapsing margins between the block and the toolbar
94-
&:before {
95-
content: "";
96-
display: table;
97-
clear: both;
98-
}
99-
}
91+
// prevent collapsing margins between block and toolbar, matches the 20px bottom offset
92+
margin-top: -$sticky-bottom-offset - 1px;
93+
padding-top: 1px;
94+
}
10095

10196
.editor-visual-editor__block-controls .components-toolbar {
10297
display: inline-flex;

0 commit comments

Comments
 (0)