Skip to content

Commit

Permalink
Fix selector specificity and legacy layout logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Sep 23, 2022
1 parent 1b29729 commit 08fe809
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 2 additions & 6 deletions packages/block-editor/src/hooks/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,9 @@ export function useLayoutStyles( block = {}, selector ) {
const { layout = {}, style = {} } = attributes;
// Update type for blocks using legacy layouts.
const usedLayout =
layout &&
( layout?.type === 'constrained' ||
layout?.inherit ||
layout?.contentSize ||
layout?.wideSize )
layout?.inherit || layout?.contentSize || layout?.wideSize
? { ...layout, type: 'constrained' }
: { ...layout, type: 'default' };
: layout || {};
const fullLayoutType = getLayoutType( usedLayout?.type || 'default' );
const globalLayoutSettings = useSetting( 'layout' ) || {};
const blockGapSupport = useSetting( 'spacing.blockGap' );
Expand Down
3 changes: 1 addition & 2 deletions packages/edit-post/src/components/visual-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,13 @@ export default function VisualEditor( { styles } ) {
const blockListLayoutClass = classnames(
{
'is-layout-flow': ! themeSupportsLayout,
'wp-container-visual-editor': themeSupportsLayout,
},
postContentLayoutClasses
);

const postContentLayoutStyles = useLayoutStyles(
postContentBlock,
'.wp-container-visual-editor'
'.block-editor-block-list__layout.is-root-container'
);

const { attributes = {} } = postContentBlock;
Expand Down

0 comments on commit 08fe809

Please sign in to comment.