diff --git a/packages/edit-post/src/components/preferences-modal/index.js b/packages/edit-post/src/components/preferences-modal/index.js
index 110b90669b4ec3..ccd323f3380386 100644
--- a/packages/edit-post/src/components/preferences-modal/index.js
+++ b/packages/edit-post/src/components/preferences-modal/index.js
@@ -13,12 +13,14 @@ import {
__experimentalItemGroup as ItemGroup,
__experimentalItem as Item,
__experimentalHStack as HStack,
+ __experimentalText as Text,
__experimentalTruncate as Truncate,
FlexItem,
Modal,
TabPanel,
Button,
Card,
+ CardHeader,
CardBody,
} from '@wordpress/components';
import { isRTL, __ } from '@wordpress/i18n';
@@ -325,10 +327,10 @@ export default function PreferencesModal() {
);
} else {
modalContent = (
-
-
-
-
+
+
+
+
{ tabs.map( ( tab ) => {
return (
@@ -358,12 +360,21 @@ export default function PreferencesModal() {
);
} ) }
-
- { sections.map( ( section ) => {
- return (
-
+
+
+ { sections.map( ( section ) => {
+ return (
+
+
+
- { __( 'Back' ) }
-
- { section.tabLabel }
- { section.content }
-
- );
- } ) }
-
-
-
+ />
+ { section.tabLabel }
+
+ { section.content }
+
+
+ );
+ } ) }
+
);
}
return (
diff --git a/packages/edit-post/src/components/preferences-modal/style.scss b/packages/edit-post/src/components/preferences-modal/style.scss
index 2fbae2cbfa263c..f72eea64aca6cf 100644
--- a/packages/edit-post/src/components/preferences-modal/style.scss
+++ b/packages/edit-post/src/components/preferences-modal/style.scss
@@ -14,7 +14,7 @@ $vertical-tabs-width: 160px;
height: 70%;
}
- // Clears spacing to flush fit the navigation component to the modal edges.
+ // Clears spacing to flush fit the navigator component to the modal edges.
@media (max-width: #{ ($break-medium - 1) }) {
.components-modal__content {
padding: 0;
@@ -23,45 +23,10 @@ $vertical-tabs-width: 160px;
content: none;
}
}
- }
-
- .components-navigation {
- padding: 0;
- max-height: 100%;
- overflow-y: auto;
- color: $black;
-
- > * {
- // Matches spacing cleared from the modal content element.
- padding: $grid-unit-30 $grid-unit-40;
- }
-
- .components-navigation__menu {
- margin: 0;
-
- .components-navigation__item {
- & > button {
- padding: 3px $grid-unit-20;
- height: $grid-unit-60;
- // Aligns button text instead of button box.
- margin: 0 #{-$grid-unit-20};
- width: calc(#{$grid-unit-40} + 100%);
- &:focus {
- font-weight: 500;
- }
- }
- }
- .components-navigation__menu-title-heading {
- border-bottom: 1px solid $gray-300;
- padding-left: 0;
- padding-right: 0;
- }
- .components-navigation__back-button {
- padding-left: 0;
- }
- .edit-post-preferences-modal__custom-fields-confirmation-button {
- width: auto;
- }
+ // Keep the navigator component from overflowing the modal content area
+ // to ensure that sticky position elements stick where intended.
+ .components-navigator-provider {
+ height: 100%;
}
}
@@ -102,6 +67,7 @@ $vertical-tabs-width: 160px;
&__section-title {
font-size: 0.9rem;
font-weight: 600;
+ margin-top: 0;
}
&__option {
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 9d853c8dac30bb..733a2b82a410b9 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
@@ -40,16 +40,17 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
onRequestClose={[Function]}
title="Preferences"
>
-
-
-
+
-
+
-
-
+
+
+
+
+
+
- Back
-
-
General
-
+
+
+
-
-
+
+
+
+
+
+
- Back
-
-
Blocks
-
+
+
+
-
-
+
+
+
+
+
+
- Back
-
-
Panels
-
+
+
+
-
-
-
-
+
+
+
+
`;