Skip to content
Merged
6 changes: 6 additions & 0 deletions packages/block-editor/src/hooks/custom-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useInstanceId } from '@wordpress/compose';
import { getBlockType, hasBlockSupport } from '@wordpress/blocks';
import { __, sprintf } from '@wordpress/i18n';
import { processCSSNesting } from '@wordpress/global-styles-engine';
import { useBlockEditingMode } from '../components/block-editing-mode';

/**
* Internal dependencies
Expand All @@ -33,6 +34,11 @@ const EMPTY_STYLE = {};
* @param {Object} props.style Block style attribute.
*/
function CustomCSSControl( { blockName, setAttributes, style } ) {
const blockEditingMode = useBlockEditingMode();

if ( blockEditingMode !== 'default' ) {
return null;
}
const blockType = getBlockType( blockName );

function onChange( newStyle ) {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/site-editor/navigation-editor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ test.describe( 'Editing Navigation Menus', () => {
sidebar.getByRole( 'tab', { name: 'Document Overview' } )
).toBeHidden();

// The Settings tab is visible due to Custom CSS support.
await expect(
sidebar.getByRole( 'tab', { name: 'Settings' } )
).toBeVisible();
).toBeHidden();

await expect(
sidebar.getByRole( 'tab', { name: 'Styles' } )
).toBeHidden();
Expand Down
Loading