From 882964ba0dafad67275b9f1ef72dd952886e8cfa Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Tue, 31 Oct 2017 10:42:05 -0400 Subject: [PATCH 1/2] Styles: Fail loudly when z-index key not in mapping --- editor/assets/stylesheets/_z-index.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/editor/assets/stylesheets/_z-index.scss b/editor/assets/stylesheets/_z-index.scss index 0c59ba46e1d2d..eed2d35e01c7c 100644 --- a/editor/assets/stylesheets/_z-index.scss +++ b/editor/assets/stylesheets/_z-index.scss @@ -42,5 +42,9 @@ $z-layers: ( ); @function z-index( $key ) { - @return map-get( $z-layers, $key ); + @if map-has-key( $z-layers, $key ) { + @return map-get( $z-layers, $key ); + } + + @error "Error: Specified z-index `#{$key}` does not exist in the mapping"; } From 9f312685920910a822049366976f4f3effc9c55c Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Tue, 31 Oct 2017 10:42:25 -0400 Subject: [PATCH 2/2] Blocks: Restore freeform block toolbar z-index --- blocks/library/freeform/editor.scss | 2 +- editor/assets/stylesheets/_z-index.scss | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/blocks/library/freeform/editor.scss b/blocks/library/freeform/editor.scss index dc26a3c479819..4f2d1039cfe02 100644 --- a/blocks/library/freeform/editor.scss +++ b/blocks/library/freeform/editor.scss @@ -88,7 +88,7 @@ .freeform-toolbar { width: auto; top: $header-height - 1px; - z-index: z-index( '.editor-block-toolbar' ); + z-index: z-index( '.freeform-toolbar' ); position: sticky; @include break-medium() { diff --git a/editor/assets/stylesheets/_z-index.scss b/editor/assets/stylesheets/_z-index.scss index eed2d35e01c7c..31e52e46d3c3f 100644 --- a/editor/assets/stylesheets/_z-index.scss +++ b/editor/assets/stylesheets/_z-index.scss @@ -7,6 +7,7 @@ $z-layers: ( '.editor-visual-editor__block:before': -1, '.editor-visual-editor__block .wp-block-more:before': -1, '.editor-visual-editor__block {core/image aligned left or right}': 20, + '.freeform-toolbar': 10, '.editor-visual-editor__block-warning': 1, '.editor-visual-editor__sibling-inserter': 1, '.components-form-toggle__input': 1,