Skip to content

Commit

Permalink
Edit site: remove empty preview border and redirect to editor in glob…
Browse files Browse the repository at this point in the history
…al styles navigation (#67548)

Co-authored-by: ramonjd <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: talldan <[email protected]>
  • Loading branch information
4 people authored Dec 4, 2024
1 parent 944c5b0 commit bb56ce8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/edit-site/src/components/global-styles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@
// The &#{&} is a workaround for the specificity of the Card component.
&#{&},
&#{&} .edit-site-global-styles-screen-root__active-style-tile-preview {
box-shadow: none;
border-radius: $radius-small;
.block-editor-iframe__container {
border: 1px solid $gray-200;
}
}
}
21 changes: 20 additions & 1 deletion packages/edit-site/src/components/site-editor-routes/styles.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
/**
* WordPress dependencies
*/
import { privateApis as routerPrivateApis } from '@wordpress/router';

/**
* Internal dependencies
*/
import Editor from '../editor';
import { unlock } from '../../lock-unlock';
import SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';
import GlobalStylesUIWrapper from '../sidebar-global-styles-wrapper';

const { useLocation } = unlock( routerPrivateApis );

function MobileGlobalStylesUI() {
const { query = {} } = useLocation();
const { canvas } = query;

if ( canvas === 'edit' ) {
return <Editor />;
}

return <GlobalStylesUIWrapper />;
}

export const stylesRoute = {
name: 'styles',
path: '/styles',
areas: {
content: <GlobalStylesUIWrapper />,
sidebar: <SidebarNavigationScreenGlobalStyles backPath="/" />,
preview: <Editor />,
mobile: <GlobalStylesUIWrapper />,
mobile: <MobileGlobalStylesUI />,
},
widths: {
content: 380,
Expand Down

0 comments on commit bb56ce8

Please sign in to comment.