diff --git a/packages/block-editor/src/components/inspector-controls-tabs/index.js b/packages/block-editor/src/components/inspector-controls-tabs/index.js index 76252bae975ae..9e348ab4b1ed1 100644 --- a/packages/block-editor/src/components/inspector-controls-tabs/index.js +++ b/packages/block-editor/src/components/inspector-controls-tabs/index.js @@ -5,6 +5,8 @@ import { Button, privateApis as componentsPrivateApis, } from '@wordpress/components'; +import { store as preferencesStore } from '@wordpress/preferences'; +import { useSelect } from '@wordpress/data'; /** * Internal dependencies @@ -24,6 +26,10 @@ export default function InspectorControlsTabs( { hasBlockStyles, tabs, } ) { + const showIconLabels = useSelect( ( select ) => { + return select( preferencesStore ).get( 'core', 'showIconLabels' ); + }, [] ); + // The tabs panel will mount before fills are rendered to the list view // slot. This means the list view tab isn't initially included in the // available tabs so the panel defaults selection to the settings tab @@ -43,10 +49,16 @@ export default function InspectorControlsTabs( { tabId={ tab.name } render={ } /> ) ) } diff --git a/packages/block-editor/src/components/inspector-controls-tabs/style.scss b/packages/block-editor/src/components/inspector-controls-tabs/style.scss index b4a5bab007ff3..70614f56dbcb3 100644 --- a/packages/block-editor/src/components/inspector-controls-tabs/style.scss +++ b/packages/block-editor/src/components/inspector-controls-tabs/style.scss @@ -1,14 +1,7 @@ .show-icon-labels { .block-editor-block-inspector__tabs [role="tablist"] { - .components-button.has-icon { - // Hide the button icons when labels are set to display... - svg { - display: none; - } - // ... and display labels. - &::after { - content: attr(aria-label); - } + .components-button { + justify-content: center; } } }