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

Update full screen modal dimensions, and pattern grids #49894

Merged
merged 4 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default function PatternSelectionModal( {
overlayClassName="block-library-query-pattern__selection-modal"
title={ __( 'Choose a pattern' ) }
onRequestClose={ () => setIsPatternSelectionModalOpen( false ) }
isFullScreen={ true }
>
<div className="block-library-query-pattern__selection-content">
<div className="block-library-query-pattern__selection-search">
Expand Down
19 changes: 8 additions & 11 deletions packages/block-library/src/query/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,17 @@
}

.block-library-query-pattern__selection-modal {
// To keep modal dimensions consistent as subsections are navigated, width
// and height are used instead of max-(width/height).
.components-modal__frame {
@include break-small() {
width: calc(100% - #{$grid-unit-20 * 2});
height: calc(100% - #{$header-height * 2});
}

@include break-medium() {
width: $break-medium - $grid-unit-20 * 2;
.block-editor-block-patterns-list {
column-count: 2;
column-gap: $grid-unit-30;

@include break-wide() {
column-count: 3;
}

@include break-large() {
height: 70%;
.block-editor-block-patterns-list__list-item {
break-inside: avoid-column;
}
}

Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/template-part/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export default function TemplatePartEdit( {
onRequestClose={ () =>
setIsTemplatePartSelectionOpen( false )
}
isFullScreen={ true }
>
<TemplatePartSelectionModal
templatePartId={ templatePartId }
Expand Down
20 changes: 9 additions & 11 deletions packages/block-library/src/template-part/editor.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
.block-editor-template-part__selection-modal {
z-index: z-index(".block-editor-template-part__selection-modal");

// To keep modal dimensions consistent as subsections are navigated, width
// and height are used instead of max-(width/height).
.components-modal__frame {
@include break-small() {
width: calc(100% - #{$grid-unit-20 * 2});
height: calc(100% - #{$header-height * 2});
}
@include break-medium() {
width: $break-medium - $grid-unit-20 * 2;
.block-editor-block-patterns-list {
column-count: 2;
column-gap: $grid-unit-30;

@include break-wide() {
column-count: 3;
}
@include break-large() {
height: 70%;

.block-editor-block-patterns-list__list-item {
break-inside: avoid-column;
}
}
}
Expand Down
12 changes: 10 additions & 2 deletions packages/components/src/modal/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,16 @@
@include reduce-motion("animation");

&.is-full-screen {
width: 90vw;
min-height: 90vh;
@include break-small() {
width: calc(100% - #{ $grid-unit-20 * 2 });
height: calc(100% - #{ $grid-unit-20 * 2 });
max-height: none;
}
@include break-medium() {
width: calc(100% - #{ $grid-unit-50 * 2 });
height: calc(100% - #{ $grid-unit-50 * 2 });
max-width: none;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export default function StartPageOptions() {
<Modal
className="edit-post-start-page-options__modal"
title={ __( 'Choose a pattern' ) }
isFullScreen={ true }
onRequestClose={ () => {
setModalState( START_PAGE_MODAL_STATES.CLOSED );
} }
Expand Down
15 changes: 0 additions & 15 deletions packages/edit-post/src/components/start-page-options/style.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
.edit-post-start-page-options__modal {
// To keep modal dimensions consistent as subsections are navigated, width
// and height are used instead of max-(width/height).
@include break-small() {
width: 95vw;
height: 95vh;
max-height: none;
}
@include break-medium() {
width: 90vw;
height: 90vh;
max-width: none;
}
}

// 2 column masonry layout.
.edit-post-start-page-options__modal-content .block-editor-block-patterns-list {
column-count: 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ function StartModal( { slug, isCustom, onClose, postType } ) {
closeLabel={ __( 'Cancel' ) }
focusOnMount="firstElement"
onRequestClose={ onClose }
isFullScreen={ true }
>
<div className="edit-site-start-template-options__modal-content">
<PatternSelection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
.edit-site-start-template-options__modal.components-modal__frame {
// To keep modal dimensions consistent as subsections are navigated, width
// and height are used instead of max-(width/height).
@include break-small() {
width: calc(100% - #{ $grid-unit-20 * 2 });
height: auto;
}
@include break-medium() {
width: 95%;
}
@include break-large() {
max-height: 95%;
}
}

.edit-site-start-template-options__modal-content .block-editor-block-patterns-list {
display: flex;
flex-wrap: wrap;
Expand Down