Skip to content

Commit 816e235

Browse files
reintroduce padding prop as default false
1 parent 14e5b47 commit 816e235

File tree

6 files changed

+22
-5
lines changed

6 files changed

+22
-5
lines changed

packages/admin-ui/src/page/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function Page( {
1717
children,
1818
className,
1919
actions,
20+
hasPadding = false,
2021
}: {
2122
breadcrumbs?: React.ReactNode;
2223
badges?: React.ReactNode;
@@ -40,7 +41,13 @@ function Page( {
4041
actions={ actions }
4142
/>
4243
) }
43-
{ children }
44+
{ hasPadding ? (
45+
<div className="admin-ui-page__content has-padding">
46+
{ children }
47+
</div>
48+
) : (
49+
children
50+
) }
4451
</NavigableRegion>
4552
);
4653
}

packages/admin-ui/src/page/style.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@
3232
margin: 0;
3333
}
3434

35+
.admin-ui-page__content {
36+
flex-grow: 1;
37+
overflow: auto;
38+
display: flex;
39+
flex-direction: column;
40+
41+
&.has-padding {
42+
padding: $grid-unit-20 $grid-unit * 2.5;
43+
@container (max-width: 430px) {
44+
padding: $grid-unit-20 $grid-unit-30;
45+
}
46+
}
47+
}
48+
3549
// Show button text labels when preference is enabled.
3650
.show-icon-labels {
3751
.admin-ui-page__header-actions {

packages/edit-site/src/components/page-patterns/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ export default function DataviewsPatterns() {
217217
<PatternsActions />
218218
</>
219219
}
220-
hasPadding={ false }
221220
>
222221
<DataViews
223222
key={ categoryId + postType }

packages/edit-site/src/components/page-templates/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ export default function PageTemplates() {
254254
<AddNewTemplate />
255255
</>
256256
}
257-
hasPadding={ false }
258257
>
259258
<DataViews
260259
key={ activeView }

packages/edit-site/src/components/post-list/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ export default function PostList( { postType } ) {
254254
) }
255255
</>
256256
}
257-
hasPadding={ false }
258257
>
259258
<DataViews
260259
key={ activeView }

packages/edit-site/src/components/sidebar-global-styles-wrapper/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ export default function GlobalStylesUIWrapper() {
132132
}
133133
className="edit-site-styles"
134134
title={ __( 'Styles' ) }
135-
hasPadding={ false }
136135
>
137136
<GlobalStylesUI path={ section } onPathChange={ onChangeSection } />
138137
</Page>

0 commit comments

Comments
 (0)