From 8040a0f043336a1eb414da91fef3d7bda67747fe Mon Sep 17 00:00:00 2001 From: Joen Asmussen Date: Wed, 10 May 2017 13:36:33 +0200 Subject: [PATCH] Fix issue with margi on blocks with no toolbars This fixes an issue with the current embed block placeholder, which has an empty toolbar. With the recent merge of the position sticky toolbars, we're using some negative margins, which when the toolbar isn't present, caused some bleed issues. --- editor/assets/stylesheets/_variables.scss | 1 + editor/modes/visual-editor/style.scss | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/assets/stylesheets/_variables.scss b/editor/assets/stylesheets/_variables.scss index b9114769784c3..9cbbd16b35513 100644 --- a/editor/assets/stylesheets/_variables.scss +++ b/editor/assets/stylesheets/_variables.scss @@ -52,6 +52,7 @@ $text-editor-max-width: 760px; /* Editor */ $text-editor-max-width: 760px; $visual-editor-max-width: 700px; +$block-controls-height: 46px; /* Blocks */ $block-padding: 14px; diff --git a/editor/modes/visual-editor/style.scss b/editor/modes/visual-editor/style.scss index 357f7889aaca5..07180ac45ffdd 100644 --- a/editor/modes/visual-editor/style.scss +++ b/editor/modes/visual-editor/style.scss @@ -76,8 +76,9 @@ display: flex; position: sticky; z-index: 1; - margin-top: -46px - $item-spacing; // 46 is toolbar height + margin-top: -$block-controls-height - $item-spacing; margin-bottom: $item-spacing + 20px; // 20px is the offset from the bottom of the selected block where it stops sticking + height: $block-controls-height; top: $header-height + $admin-bar-height-big + $item-spacing;