From b801940703e1510be3e7c2e696338fb13d24b810 Mon Sep 17 00:00:00 2001 From: MaggieCabrera Date: Wed, 17 Jul 2024 12:47:14 +0200 Subject: [PATCH 1/2] hide toolbar when block is not full width --- .../components/block-tools/use-show-block-tools.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/block-editor/src/components/block-tools/use-show-block-tools.js b/packages/block-editor/src/components/block-tools/use-show-block-tools.js index 70a0b9f53a342..33807445b8da7 100644 --- a/packages/block-editor/src/components/block-tools/use-show-block-tools.js +++ b/packages/block-editor/src/components/block-tools/use-show-block-tools.js @@ -45,8 +45,13 @@ export function useShowBlockTools() { editorMode === 'navigation'; const isZoomOut = editorMode === 'zoom-out'; + const _showZoomOutToolbar = + isZoomOut && + block?.attributes?.align === 'full' && + ! _showEmptyBlockSideInserter && + ! maybeShowBreadcrumb; const _showBlockToolbarPopover = - ! isZoomOut && + ! _showZoomOutToolbar && ! getSettings().hasFixedToolbar && ! _showEmptyBlockSideInserter && hasSelectedBlock && @@ -58,12 +63,7 @@ export function useShowBlockTools() { showBreadcrumb: ! _showEmptyBlockSideInserter && maybeShowBreadcrumb, showBlockToolbarPopover: _showBlockToolbarPopover, - showZoomOutToolbar: - hasSelectedBlock && - isZoomOut && - ! _showEmptyBlockSideInserter && - ! maybeShowBreadcrumb && - ! _showBlockToolbarPopover, + showZoomOutToolbar: _showZoomOutToolbar, }; }, [] ); } From 4ecc3a90b854f8de9c723db9d5d293c4705e0503 Mon Sep 17 00:00:00 2001 From: MaggieCabrera Date: Fri, 19 Jul 2024 17:09:45 +0200 Subject: [PATCH 2/2] fix unwanted centering, show regular toolbars on non full width blocks --- packages/block-editor/src/components/iframe/content.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/iframe/content.scss b/packages/block-editor/src/components/iframe/content.scss index caae348a0ab76..8c03d4224745a 100644 --- a/packages/block-editor/src/components/iframe/content.scss +++ b/packages/block-editor/src/components/iframe/content.scss @@ -54,7 +54,7 @@ display: flex; flex-direction: column; - > .is-root-container { + > .is-root-container:not(.wp-block-post-content) { flex: 1; display: flex; flex-direction: column;