Skip to content

Commit 6534211

Browse files
ramonjdandrewserongannezazuiamtakashi
authored
Site editor global styles settings: preserve non-global styles in default site editor settings (#74088)
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: andrewserong <andrewserong@git.wordpress.org> Co-authored-by: annezazu <annezazu@git.wordpress.org> Co-authored-by: iamtakashi <iamtakashi@git.wordpress.org>
1 parent e51d410 commit 6534211

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packages/edit-site/src/components/block-editor/use-site-editor-settings.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,15 @@ export function useSpecificEditorSettings() {
7373
}, [ mergedConfig ] );
7474

7575
const defaultEditorSettings = useMemo( () => {
76+
// Preserve non-global styles from settings.styles (e.g., editor styles from add_editor_style)
77+
const nonGlobalStyles = ( settings?.styles ?? [] ).filter(
78+
( style ) => ! style.isGlobalStyles
79+
);
80+
7681
return {
7782
...settings,
7883
styles: [
84+
...nonGlobalStyles,
7985
...globalStyles,
8086
{
8187
// Forming a "block formatting context" to prevent margin collapsing.

0 commit comments

Comments
 (0)