Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix error with display of Heading block style variations in style book.
  • Loading branch information
tellthemachines committed Oct 22, 2025
commit d860a291a6d77d5dc19b1b3f4cd7c3e9daba1974
36 changes: 23 additions & 13 deletions packages/edit-site/src/components/style-book/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,19 +224,29 @@ function applyBlockVariationsToExamples( examples, variation ) {
if ( ! variation ) {
return examples;
}

return examples.map( ( example ) => ( {
...example,
variation,
blocks: {
...example.blocks,
attributes: {
...example.blocks.attributes,
style: undefined,
className: getVariationClassName( variation ),
},
},
} ) );
return examples.map( ( example ) => {
return {
...example,
variation,
blocks: Array.isArray( example.blocks )
? example.blocks.map( ( block ) => ( {
...block,
attributes: {
...block.attributes,
style: undefined,
className: getVariationClassName( variation ),
},
} ) )
: {
...example.blocks,
attributes: {
...example.blocks.attributes,
style: undefined,
className: getVariationClassName( variation ),
},
},
};
} );
}

function StyleBook( {
Expand Down
Loading