Skip to content

Commit c08b5d7

Browse files
authored
I'm not really sure if this is right, but this commit will show the inherit toggle regardless of whether there is a defaultThemeLayout value. (#59580)
Presently, an empty object will pass the test so perhaps it's okay to remove the check? Also a bit of ESlint stuff for redundant var `css`
1 parent a0cb09b commit c08b5d7

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

packages/block-editor/src/hooks/layout.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,13 @@ export function useLayoutStyles( blockAttributes = {}, blockName, selector ) {
125125
const fullLayoutType = getLayoutType( usedLayout?.type || 'default' );
126126
const [ blockGapSupport ] = useSettings( 'spacing.blockGap' );
127127
const hasBlockGapSupport = blockGapSupport !== null;
128-
const css = fullLayoutType?.getLayoutStyle?.( {
128+
return fullLayoutType?.getLayoutStyle?.( {
129129
blockName,
130130
selector,
131131
layout,
132132
style,
133133
hasBlockGapSupport,
134134
} );
135-
return css;
136135
}
137136

138137
function LayoutPanelPure( {
@@ -144,8 +143,6 @@ function LayoutPanelPure( {
144143
const settings = useBlockSettings( blockName );
145144
// Block settings come from theme.json under settings.[blockName].
146145
const { layout: layoutSettings } = settings;
147-
// Layout comes from block attributes.
148-
const [ defaultThemeLayout ] = useSettings( 'layout' );
149146
const { themeSupportsLayout } = useSelect( ( select ) => {
150147
const { getSettings } = select( blockEditorStore );
151148
return {
@@ -180,11 +177,9 @@ function LayoutPanelPure( {
180177
}
181178

182179
// Only show the inherit toggle if it's supported,
183-
// a default theme layout is set (e.g. one that provides `contentSize` and/or `wideSize` values),
184180
// and either the default / flow or the constrained layout type is in use, as the toggle switches from one to the other.
185181
const showInheritToggle = !! (
186182
allowInheriting &&
187-
!! defaultThemeLayout &&
188183
( ! layout?.type ||
189184
layout?.type === 'default' ||
190185
layout?.type === 'constrained' ||

0 commit comments

Comments
 (0)