From 207fddd85590921739b4185f9a204dda3182a223 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Tue, 16 May 2023 10:17:23 +0200 Subject: [PATCH 1/3] Template pattern modal: remove internal modal classnames --- packages/components/src/modal/index.tsx | 7 +--- .../start-template-options/style.scss | 41 +++++++++---------- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/packages/components/src/modal/index.tsx b/packages/components/src/modal/index.tsx index a22dc2a4ec671..d9c7b602b8392 100644 --- a/packages/components/src/modal/index.tsx +++ b/packages/components/src/modal/index.tsx @@ -252,12 +252,7 @@ function UnforwardedModal( ) } ) } -
- { children } -
+
{ children }
diff --git a/packages/edit-site/src/components/start-template-options/style.scss b/packages/edit-site/src/components/start-template-options/style.scss index 715e829ecab3a..7515861099b38 100644 --- a/packages/edit-site/src/components/start-template-options/style.scss +++ b/packages/edit-site/src/components/start-template-options/style.scss @@ -1,28 +1,27 @@ -.edit-site-start-template-options__modal { - .components-modal__content { - padding-bottom: 0; - } +$actions-height: 92px; - .components-modal__children-container { - display: flex; - height: 100%; - flex-direction: column; - - .edit-site-start-template-options__modal__actions { - margin-top: auto; - position: sticky; - bottom: 0; - background-color: $white; - margin-left: - $grid-unit-40; - margin-right: - $grid-unit-40; - padding: $grid-unit-30 $grid-unit-40 $grid-unit-40; - border-top: 1px solid $gray-300; - z-index: z-index(".edit-site-start-template-options__modal__actions"); - } +.edit-site-start-template-options__modal { + .edit-site-start-template-options__modal__actions { + position: absolute; + bottom: 0; + width: 100%; + height: $actions-height; + background-color: $white; + margin-left: - $grid-unit-40; + margin-right: - $grid-unit-40; + padding-left: $grid-unit-40; + padding-right: $grid-unit-40; + border-top: 1px solid $gray-300; + z-index: z-index(".edit-site-start-template-options__modal__actions"); } .block-editor-block-patterns-list { - padding-bottom: $grid-unit-40; + // Since the actions container is positioned absolutely, + // this padding bottom ensures that the content wrapper will properly + // detect overflowing content and start showing scrollbars at the right + // moment. Without this padding, the content would render under the actions + // bar without causing the wrapper to show a scrollbar. + padding-bottom: $actions-height; } } From 2b405c81a7fba48f029163622b90fe34899960c3 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Tue, 16 May 2023 10:38:36 +0200 Subject: [PATCH 2/3] Update snapshots --- .../test/__snapshots__/index.js.snap | 4 +--- .../preferences-modal/test/__snapshots__/index.js.snap | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/edit-post/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap b/packages/edit-post/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap index 5311dfa07b5c4..2ad8e457bae30 100644 --- a/packages/edit-post/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +++ b/packages/edit-post/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap @@ -43,9 +43,7 @@ exports[`KeyboardShortcutHelpModal should match snapshot when the modal is activ -
+
diff --git a/packages/edit-post/src/components/preferences-modal/test/__snapshots__/index.js.snap b/packages/edit-post/src/components/preferences-modal/test/__snapshots__/index.js.snap index 5a6ff1e5fffee..2d43aa7922f36 100644 --- a/packages/edit-post/src/components/preferences-modal/test/__snapshots__/index.js.snap +++ b/packages/edit-post/src/components/preferences-modal/test/__snapshots__/index.js.snap @@ -102,9 +102,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
-
+
@@ -725,9 +723,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
-
+
Date: Tue, 16 May 2023 10:40:05 +0200 Subject: [PATCH 3/3] CHANGELOG --- packages/components/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index d49f137f467c8..6e46c3b70f495 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Internal + +- `Modal`: Remove children container's unused class name ([#50655](https://github.com/WordPress/gutenberg/pull/50655)). + ## 24.0.0 (2023-05-10) ### Breaking Changes