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 0c59ba46e1d2d..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, @@ -42,5 +43,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"; }