Skip to content

Commit cbdf540

Browse files
jameskosteryouknowriadjasmussen
authored
Data views: Unbox items in grid layout (#61159)
Co-authored-by: jameskoster <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: jasmussen <[email protected]>
1 parent cf7e1ea commit cbdf540

File tree

2 files changed

+34
-16
lines changed

2 files changed

+34
-16
lines changed

packages/dataviews/src/style.scss

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -292,41 +292,54 @@
292292
}
293293

294294
.dataviews-view-grid__card {
295-
border-radius: $radius-block-ui * 2;
296-
border: 1px solid $gray-200;
297295
height: 100%;
298296
justify-content: flex-start;
299297

300298
.dataviews-view-grid__title-actions {
301-
padding: $grid-unit-05 $grid-unit $grid-unit-05 $grid-unit-05;
299+
padding: $grid-unit-10 0 $grid-unit-05;
302300
}
303301

304302
.dataviews-view-grid__primary-field {
305-
min-height: $grid-unit-50;
303+
min-height: $grid-unit-40; // Preserve layout when there is no ellipsis button
306304
}
307-
&.is-selected {
308-
border-color: var(--wp-admin-theme-color);
309-
background-color: rgba(var(--wp-admin-theme-color--rgb), 0.04);
310305

306+
&.is-selected {
311307
.dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value {
312308
color: $gray-900;
313309
}
310+
311+
.page-pages-preview-field__button::after {
312+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
313+
background: rgba(var(--wp-admin-theme-color--rgb), 0.04);
314+
}
314315
}
315316
}
316317

317318
.dataviews-view-grid__media {
318319
width: 100%;
319320
min-height: 200px;
320321
aspect-ratio: 1/1;
321-
border-bottom: 1px solid $gray-200;
322322
background-color: $gray-100;
323-
border-radius: 3px 3px 0 0;
323+
border-radius: $grid-unit-05;
324+
overflow: hidden;
325+
position: relative;
324326

325327
img {
326328
object-fit: cover;
327329
width: 100%;
328330
height: 100%;
329331
}
332+
333+
&::after {
334+
content: "";
335+
position: absolute;
336+
top: 0;
337+
left: 0;
338+
width: 100%;
339+
height: 100%;
340+
box-shadow: inset 0 0 0 $border-width rgba(0, 0, 0, 0.1);
341+
border-radius: $grid-unit-05;
342+
}
330343
}
331344

332345
.dataviews-view-grid__fields {
@@ -337,7 +350,6 @@
337350
&:not(:empty) {
338351
padding: $grid-unit-15 0;
339352
padding-top: 0;
340-
margin: 0 $grid-unit-15;
341353
}
342354

343355
.dataviews-view-grid__field {
@@ -366,8 +378,7 @@
366378

367379
.dataviews-view-grid__badge-fields {
368380
&:not(:empty) {
369-
padding: $grid-unit-15;
370-
padding-top: 0;
381+
padding-bottom: $grid-unit-15;
371382
}
372383

373384
.dataviews-view-grid__field-value {
@@ -555,10 +566,6 @@
555566
flex-shrink: 0;
556567
}
557568

558-
.dataviews-view-grid__title-actions .dataviews-view-table-selection-checkbox {
559-
margin-left: $grid-unit-10;
560-
}
561-
562569
.dataviews-filter-summary__popover {
563570
.components-popover__content {
564571
width: 230px;

packages/edit-site/src/components/page-pages/style.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,15 @@
5050
// Windows High Contrast mode will show this outline, but not the box-shadow.
5151
outline: 2px solid transparent;
5252
}
53+
54+
// Make the button targetable for clicks
55+
&::after {
56+
content: "";
57+
height: 100%;
58+
left: 0;
59+
position: absolute;
60+
top: 0;
61+
width: 100%;
62+
z-index: 1;
63+
}
5364
}

0 commit comments

Comments
 (0)