Skip to content

Commit

Permalink
Display content frame in mobile for Pages when canvas is not edit and…
Browse files Browse the repository at this point in the history
… fix overlapping hub in Templates (#60409)

This extracts some existing styles in the Patterns page to the Hub component, so any Page component (Pages, Templates, Patterns) has the same styles.

Co-authored-by: oandregal <oandregal@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
  • Loading branch information
3 people authored Apr 5, 2024
1 parent 8c87d40 commit 5379531
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
7 changes: 1 addition & 6 deletions packages/edit-site/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,7 @@ export default function Layout() {
<SavePanel />

{ isMobileViewport && areas.mobile && (
<div
className="edit-site-layout__mobile"
style={ {
maxWidth: widths?.content,
} }
>
<div className="edit-site-layout__mobile">
{ areas.mobile }
</div>
) }
Expand Down
4 changes: 3 additions & 1 deletion packages/edit-site/src/components/layout/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export default function useLayoutAreas() {
mobile:
canvas === 'edit' ? (
<Editor isLoading={ isSiteEditorLoading } />
) : undefined,
) : (
<PagePages />
),
},
widths: {
content: isListLayout ? 380 : undefined,
Expand Down
7 changes: 7 additions & 0 deletions packages/edit-site/src/components/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
}
}

.edit-site-layout__header-container:has(+ .edit-site-layout__content > .edit-site-layout__mobile>.edit-site-page) {
margin-bottom: $header-height;
@include break-medium {
margin-bottom: 0;
}
}

.edit-site-layout__header-container {
z-index: z-index(".edit-site-layout__header-container");
}
Expand Down
6 changes: 0 additions & 6 deletions packages/edit-site/src/components/page-patterns/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@
}

.edit-site-page-patterns-dataviews {
margin-top: 60px;

@include break-medium {
margin-top: 0;
}

.page-patterns-preview-field {
display: flex;
flex-direction: column;
Expand Down

0 comments on commit 5379531

Please sign in to comment.