diff --git a/packages/edit-site/src/components/editor/index.js b/packages/edit-site/src/components/editor/index.js index 1a5e2a6dcaa32..440e9a4fa51e5 100644 --- a/packages/edit-site/src/components/editor/index.js +++ b/packages/edit-site/src/components/editor/index.js @@ -105,6 +105,7 @@ function Editor( { onError } ) { }; }, [] ); const { setPage, setIsInserterOpened } = useDispatch( editSiteStore ); + const { enableComplementaryArea } = useDispatch( interfaceStore ); const [ isEntitiesSavedStatesOpen, @@ -147,6 +148,19 @@ function Editor( { onError } ) { } }, [ isNavigationOpen ] ); + useEffect( + function openGlobalStylesOnLoad() { + const searchParams = new URLSearchParams( window.location.search ); + if ( searchParams.get( 'styles' ) === 'open' ) { + enableComplementaryArea( + 'core/edit-site', + 'edit-site/global-styles' + ); + } + }, + [ enableComplementaryArea ] + ); + // Don't render the Editor until the settings are set and loaded const isReady = settings?.siteUrl &&