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
4 changes: 3 additions & 1 deletion packages/admin-ui/src/page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ function Page( {
) }
{ hasPadding ? (
<div className="admin-ui-page__content has-padding">
{ children }
<div className="admin-ui-page__content-child">
{ children }
</div>
</div>
) : (
children
Expand Down
11 changes: 7 additions & 4 deletions packages/admin-ui/src/page/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@

.admin-ui-page__header {
padding: $grid-unit-20 $grid-unit-30;
border-bottom: 1px solid $gray-100;
background: $white;
position: sticky;
top: 0;
border-bottom: 1px solid $gray-100;
z-index: 2;
}

.admin-ui-page__sidebar-toggle-slot:empty {
Expand All @@ -38,8 +37,12 @@
display: flex;
flex-direction: column;

.admin-ui-page__content-child {
margin: $grid-unit-30 0 0;
}

&.has-padding {
padding: $grid-unit-20 $grid-unit-30;
padding: 0 $grid-unit-30;
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/base-styles/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ $z-layers: (
".editor-start-page-options__modal__actions": 1,

// Ensure checkbox + actions don't overlap table header
".dataviews-view-table thead": 1,
".dataviews-view-table thead": 2,

// Ensure selection checkbox stays above the preview field.
".dataviews-view-grid__card .dataviews-selection-checkbox": 1,
Expand Down
14 changes: 13 additions & 1 deletion packages/dataviews/src/components/dataviews-footer/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,27 @@
bottom: 0;
left: 0;
background-color: inherit;
padding: $grid-unit-15 $grid-unit-30;
border-top: $border-width solid $gray-100;
flex-shrink: 0;
padding-top: $grid-unit-15;
padding-bottom: $grid-unit-15;

@media not (prefers-reduced-motion) {
transition: padding ease-out 0.1s;
}

z-index: z-index(".dataviews-footer");

&::after {
content: "";
position: absolute;
top: 0;
left: -12px;
width: calc(100% + 24px);
height: 100%;
background-color: inherit;
z-index: -1;
}
}

@container (max-width: 560px) {
Expand Down
12 changes: 1 addition & 11 deletions packages/dataviews/src/components/dataviews/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

.dataviews-wrapper,
.dataviews-picker-wrapper {
height: 100%;
overflow: auto;
box-sizing: border-box;
scroll-padding-bottom: $grid-unit-80;
/* stylelint-disable-next-line property-no-unknown -- '@container' not globally permitted */
Expand All @@ -20,11 +18,11 @@
.dataviews__view-actions,
.dataviews-filters__container {
box-sizing: border-box;
padding: $grid-unit-20 $grid-unit-30;
flex-shrink: 0;
position: sticky;
left: 0;
background-color: inherit;
padding-bottom: $grid-unit-15;

@media not (prefers-reduced-motion) {
transition: padding ease-out 0.1s;
Expand All @@ -48,13 +46,6 @@
text-align: center;
}

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

.dataviews-title-field {
font-size: $default-font-size;
font-weight: $font-weight-medium;
Expand Down Expand Up @@ -107,6 +98,5 @@
*/
.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
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

.dataviews-view-activity {
margin: 0 0 auto;
padding: $grid-unit-10 $grid-unit-30;

.dataviews-view-activity__group-header {
font-size: $font-size-large;
Expand Down
1 change: 0 additions & 1 deletion packages/dataviews/src/dataviews-layouts/grid/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
@use "../utils/grid-items.scss" as *;

.dataviews-view-grid {
padding: 0 $grid-unit-30 $grid-unit-30;
display: flex;
flex-direction: column;
gap: $grid-unit-40;
Expand Down
29 changes: 27 additions & 2 deletions packages/dataviews/src/dataviews-layouts/list/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ div.dataviews-view-list {
div[role="article"] {
margin: 0;
border-top: 1px solid $gray-100;
position: relative;

.dataviews-view-list__item-wrapper {
position: relative;
padding: $grid-unit-20 $grid-unit-30;
box-sizing: border-box;
padding: $grid-unit-15 0;
}

.dataviews-view-list__item-actions {
Expand Down Expand Up @@ -78,6 +79,19 @@ div.dataviews-view-list {
color: var(--wp-admin-theme-color);
background-color: #f8f8f8;

&::after {
content: "";
position: absolute;
top: -1px;
bottom: -1px;
left: -12px;
width: calc(100% + 24px);
background-color: #f8f8f8;
border-radius: $radius-large;
border: 1px solid $gray-100;
z-index: -1;
}

.dataviews-view-list__title-field,
.dataviews-view-list__fields {
color: var(--wp-admin-theme-color);
Expand All @@ -92,14 +106,25 @@ div.dataviews-view-list {
div[role="article"].is-selected,
div[role="article"].is-selected:focus-within {
.dataviews-view-list__item-wrapper {
background-color: rgba(var(--wp-admin-theme-color--rgb), 0.04);
color: $gray-900;

.dataviews-view-list__title-field,
.dataviews-view-list__fields {
color: var(--wp-admin-theme-color);
}
}

&::after {
content: "";
position: absolute;
top: -1px;
bottom: -1px;
left: -12px;
width: calc(100% + 24px);
background-color: rgba(var(--wp-admin-theme-color--rgb), 0.04);
border-radius: $radius-large;
border: 1px solid rgba(var(--wp-admin-theme-color--rgb), 0.12);
}
}

.dataviews-view-list__item {
Expand Down
86 changes: 70 additions & 16 deletions packages/dataviews/src/dataviews-layouts/table/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
td,
th {
padding: $grid-unit-15;
position: relative;
z-index: 1;

&.dataviews-view-table__actions-column {
text-align: right;
Expand All @@ -30,7 +32,7 @@
&.dataviews-view-table__actions-column--sticky {
position: sticky;
right: 0;
background-color: inherit;
background-color: var(--wp-dataviews-color-background, #fff);
}

&.dataviews-view-table__actions-column--stuck {
Expand Down Expand Up @@ -58,24 +60,39 @@
tr {
border-top: 1px solid $gray-100;
background-color: inherit;
position: relative;

td:first-child,
th:first-child {
padding-left: $grid-unit-30;
padding-left: 0;
}

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

&:last-child {
border-bottom: 0;
}

&.is-hovered,
&.is-hovered .dataviews-view-table__actions-column--sticky {
background-color: #f8f8f8;
&.is-hovered {
&::after {
content: "";
position: absolute;
top: -0.5px;
bottom: -0.5px;
left: -12px;
width: calc(100% + 24px);
background-color: #f8f8f8;
z-index: 0;
border-radius: $radius-large;
border: 1px solid $gray-100;
}

.dataviews-view-table__actions-column--sticky {
background-color: #f8f8f8;
}
}

.dataviews-item-actions .components-button:not(.dataviews-all-actions-button) {
Expand All @@ -90,16 +107,30 @@
}

&.is-selected {
background-color: color-mix(in srgb, rgb(var(--wp-admin-theme-color--rgb)) 4%, $white);
color: $gray-700;

&::after {
content: "";
position: absolute;
top: -0.5px;
bottom: -0.5px;
left: -12px;
width: calc(100% + 24px);
background-color: color-mix(in srgb, rgb(var(--wp-admin-theme-color--rgb)) 4%, $white);
z-index: 0;
border-radius: $radius-large;
border: 1px solid rgba(var(--wp-admin-theme-color--rgb), 0.12);
}

&,
& + tr {
border-top: 1px solid rgba(var(--wp-admin-theme-color--rgb), 0.12);
}

&:hover {
background-color: color-mix(in srgb, rgb(var(--wp-admin-theme-color--rgb)) 8%, $white);
&::after {
background-color: color-mix(in srgb, rgb(var(--wp-admin-theme-color--rgb)) 8%, $white);
}
}

.dataviews-view-table__actions-column--sticky {
Expand All @@ -117,9 +148,23 @@
tr {
// Only apply hover background to non-selected rows
&:not(.is-selected) {
&.is-hovered,
&.is-hovered .dataviews-view-table__actions-column--sticky {
background-color: #f8f8f8;
&.is-hovered {
&::after {
content: "";
position: absolute;
top: -0.5px;
bottom: -0.5px;
left: -12px;
width: calc(100% + 24px);
background-color: #f8f8f8;
z-index: 0;
border-radius: $radius-large;
border: 1px solid $gray-100;
}

.dataviews-view-table__actions-column--sticky {
background-color: #f8f8f8;
}
}
}

Expand All @@ -140,6 +185,17 @@
z-index: z-index(".dataviews-view-table thead");
background-color: inherit;

&::after {
content: "";
position: absolute;
top: 0.5px;
bottom: 0.5px;
left: -12px;
width: calc(100% + 24px);
background-color: inherit;
z-index: 0;
}

tr {
border: 0;
}
Expand All @@ -161,13 +217,11 @@
}

&:has(.dataviews-view-table-header-button):first-child {
// Table cell padding minus the header button padding.
padding-left: $grid-unit-50;
padding-left: 0;
}

&:has(.dataviews-view-table-header-button):last-child {
// Table cell padding minus the header button padding.
padding-right: $grid-unit-50;
padding-right: 0;
}
}
}
Expand Down Expand Up @@ -305,7 +359,7 @@
.dataviews-view-table__group-header-row {
.dataviews-view-table__group-header-cell {
font-weight: $font-weight-medium;
padding: $grid-unit-15 $grid-unit-30;
padding: $grid-unit-15 0;
color: $gray-900;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
gap: $grid-unit-40;
grid-template-rows: max-content;
grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
padding: 0 $grid-unit-30 $grid-unit-30;
padding: 0 0 $grid-unit-30;
container-type: inline-size;

@media not (prefers-reduced-motion) {
Expand Down
8 changes: 0 additions & 8 deletions packages/dataviews/src/stories/dataviews-picker.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,6 @@ export const WithModal = ( {
) }
{ isModalOpen && (
<>
<style>{ `
.components-modal__content {
padding: 0;
}
.components-modal__frame.is-full-screen .components-modal__content {
margin-bottom: 0;
}
` }</style>
<Modal
title="Select Items"
onRequestClose={ () => setIsModalOpen( false ) }
Expand Down
1 change: 0 additions & 1 deletion packages/dataviews/src/stories/dataviews.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,6 @@ export const InfiniteScroll = () => {
<style>{ `
.dataviews-wrapper {
height: 600px;
overflow: auto;
}
` }</style>
<Text
Expand Down
Loading
Loading