Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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 @@ -7,7 +7,7 @@
bottom: 0;
left: 0;
background-color: $white;
padding: $grid-unit-15 $grid-unit-60;
padding-top: $grid-unit-15;
border-top: $border-width solid $gray-100;
flex-shrink: 0;

Expand All @@ -18,12 +18,6 @@
z-index: z-index(".dataviews-footer");
}

@container (max-width: 430px) {
.dataviews-footer {
padding: $grid-unit-15 $grid-unit-30;
}
}

@container (max-width: 560px) {
.dataviews-footer {
flex-direction: column !important;
Expand Down
44 changes: 1 addition & 43 deletions packages/dataviews/src/components/dataviews/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
.dataviews__view-actions,
.dataviews-filters__container {
box-sizing: border-box;
padding: $grid-unit-20 $grid-unit-60;
padding-bottom: $grid-unit-20;
flex-shrink: 0;
position: sticky;
left: 0;
Expand All @@ -31,7 +31,6 @@

.dataviews-no-results,
.dataviews-loading {
padding: 0 $grid-unit-60;
flex-grow: 1;
display: flex;
align-items: center;
Expand All @@ -46,19 +45,6 @@
text-align: center;
}

@container (max-width: 430px) {
.dataviews__view-actions,
.dataviews-filters__container {
padding: $grid-unit-15 $grid-unit-30;
}

.dataviews-no-results,
.dataviews-loading {
padding-left: $grid-unit-30;
padding-right: $grid-unit-30;
}
}

.dataviews-title-field {
font-size: $default-font-size;
font-weight: $font-weight-medium;
Expand Down Expand Up @@ -105,31 +91,3 @@
}
@include link-reset();
}

/**
* Applying a consistent 24px padding when DataViews are placed within cards.
*/
.components-card__body:has(> .dataviews-wrapper),
.components-card__body:has(> .dataviews-picker-wrapper) {
padding: $grid-unit-10 0 0;
overflow: hidden; // Prevent cells with white backgrounds overflowing the card

.dataviews__view-actions,
.dataviews-filters__container,
.dataviews-footer,
.dataviews-view-grid,
.dataviews-loading,
.dataviews-no-results {
padding-inline: $grid-unit-30;
}

.dataviews-view-table tr td:first-child,
.dataviews-view-table tr th:first-child {
padding-inline-start: $grid-unit-30;
}

.dataviews-view-table tr td:last-child,
.dataviews-view-table tr th:last-child {
padding-inline-end: $grid-unit-30;
}
}
7 changes: 1 addition & 6 deletions packages/dataviews/src/dataviews-layouts/grid/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,6 @@
font-weight: $font-weight-medium;
color: $gray-900;
margin: 0 0 $grid-unit-10 0;
padding: 0 $grid-unit-60;
padding: 0;
container-type: inline-size;

@container (max-width: 430px) {
padding-left: $grid-unit-30;
padding-right: $grid-unit-30;
}
}
20 changes: 1 addition & 19 deletions packages/dataviews/src/dataviews-layouts/table/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,12 @@

td:first-child,
th:first-child {
padding-left: $grid-unit-60;

// TODO: Should this be removed?
.dataviews-view-table-header-button {
margin-left: - #{$grid-unit-10};
}
}

td:last-child,
th:last-child {
padding-right: $grid-unit-60;
}

&:last-child {
border-bottom: 0;
}
Expand Down Expand Up @@ -253,18 +247,6 @@
}
}

@container (max-width: 430px) {
.dataviews-view-table tr td:first-child,
.dataviews-view-table tr th:first-child {
padding-left: $grid-unit-30;
}

.dataviews-view-table tr td:last-child,
.dataviews-view-table tr th:last-child {
padding-right: $grid-unit-30;
}
}

.dataviews-view-table-selection-checkbox {
--checkbox-input-size: 24px;
@include break-small() {
Expand Down
11 changes: 2 additions & 9 deletions packages/dataviews/src/dataviews-layouts/utils/grid-items.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@
gap: $grid-unit-40;
grid-template-rows: max-content;
grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
padding: 0 $grid-unit-60 $grid-unit-30;
padding-top: 0;
padding-bottom: $grid-unit-30;
container-type: inline-size;
/**
* Breakpoints were adjusted from media queries breakpoints to account for
* the sidebar width. This was done to match the existing styles we had.
*/
@container (max-width: 430px) {
padding-left: $grid-unit-30;
padding-right: $grid-unit-30;
}

@media not (prefers-reduced-motion) {
transition: padding ease-out 0.1s;
Expand Down
22 changes: 10 additions & 12 deletions packages/dataviews/src/stories/dataviews-picker.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,18 +266,16 @@ export const WithModal = ( {
isFullScreen={ false }
size="fill"
>
<div style={ { padding: '16px' } }>
<DataViewsPickerContent
perPageSizes={ perPageSizes }
isMultiselectable={ isMultiselectable }
isGrouped={ isGrouped }
infiniteScrollEnabled={ infiniteScrollEnabled }
actions={ modalActions }
selection={ selectedItems.map( ( item ) =>
String( item.id )
) }
/>
</div>
<DataViewsPickerContent
perPageSizes={ perPageSizes }
isMultiselectable={ isMultiselectable }
isGrouped={ isGrouped }
infiniteScrollEnabled={ infiniteScrollEnabled }
actions={ modalActions }
selection={ selectedItems.map( ( item ) =>
String( item.id )
) }
/>
</Modal>
) }
</>
Expand Down
2 changes: 1 addition & 1 deletion packages/dataviews/src/stories/dataviews.style.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

.free-composition-heading,
.free-composition-header {
padding: 16px 48px;
padding: 16px 12px;
}

.free-composition-heading {
Expand Down
1 change: 1 addition & 0 deletions packages/edit-site/src/components/page-patterns/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ export default function DataviewsPatterns() {
className="edit-site-page-patterns-dataviews"
title={ title }
subTitle={ description }
hasPadding
actions={
<>
{ isModified && (
Expand Down
1 change: 1 addition & 0 deletions packages/edit-site/src/components/page-templates/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ export default function PageTemplates() {
<Page
className="edit-site-page-templates"
title={ __( 'Templates' ) }
hasPadding
actions={
<>
{ isModified && (
Expand Down
1 change: 1 addition & 0 deletions packages/edit-site/src/components/post-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ export default function PostList( { postType } ) {
return (
<Page
title={ labels?.name }
hasPadding
actions={
<>
{ isModified && (
Expand Down
Loading