Skip to content

Commit

Permalink
Update full screen modal dimensions, and pattern grids (#49894)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskoster authored Apr 20, 2023
1 parent b44e495 commit 4e94b3c
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 54 deletions.
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
2 changes: 2 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
- `TreeGrid`: Modify keyboard navigation code to use a data-expanded attribute if aria-expanded is to be controlled outside of the TreeGrid component ([#48461](https://github.com/WordPress/gutenberg/pull/48461)).
- `Modal`: Equalize internal spacing ([#49890](https://github.com/WordPress/gutenberg/pull/49890)).
- `Modal`: Increased border radius ([#49870](https://github.com/WordPress/gutenberg/pull/49870)).
- `Modal`: Updated spacing / dimensions of `isFullScreen` ([#49894](https://github.com/WordPress/gutenberg/pull/49894)).
- `SlotFill`: Added util for creating private SlotFills and supporting Symbol keys ([#49819](https://github.com/WordPress/gutenberg/pull/49819)).


### Documentation

- `Autocomplete`: Add heading and fix type for `onReplace` in README. ([#49798](https://github.com/WordPress/gutenberg/pull/49798)).
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

1 comment on commit 4e94b3c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 4e94b3c.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4752798455
📝 Reported issues:

Please sign in to comment.