Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit site: remove empty preview border and redirect to editor in global styles navigation #67548

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
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
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
Loading