Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align list and table layout visuals #61157

Merged
merged 1 commit into from May 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 13 additions & 28 deletions packages/dataviews/src/style.scss
Expand Up @@ -385,27 +385,15 @@

.dataviews-view-list {
margin: 0;
padding: $grid-unit-10;

li {
margin: 0;
cursor: pointer;

.dataviews-view-list__item-wrapper {
position: relative;
padding-right: $grid-unit-30;
border-radius: $grid-unit-05;

&::after {
position: absolute;
content: "";
top: 100%;
left: $grid-unit-30;
right: $grid-unit-30;
background: $gray-100;
height: 1px;
}

> * {
width: 100%;
}
Expand All @@ -418,6 +406,7 @@
&:hover,
&:focus-within {
color: var(--wp-admin-theme-color);
background-color: #f8f8f8;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add a var for this at some point.


.dataviews-view-list__primary-field,
.dataviews-view-list__fields {
Expand All @@ -430,37 +419,33 @@
li.is-selected,
li.is-selected:focus-within {
.dataviews-view-list__item-wrapper {
background-color: var(--wp-admin-theme-color);
color: $white;
background-color: rgba(var(--wp-admin-theme-color--rgb), 0.04);
color: $gray-900;

.dataviews-view-list__primary-field,
.dataviews-view-list__fields,
.components-button {
color: $white;
}

&::after {
background: transparent;
color: var(--wp-admin-theme-color);
}
}
}

.dataviews-view-list__item {
padding: $grid-unit-15 0 $grid-unit-15 $grid-unit-30;
padding: $grid-unit-20 $grid-unit-40;
width: 100%;
scroll-margin: $grid-unit-10 0;
border-top: 1px solid $gray-100;

&:focus-visible {
&::before {
position: absolute;
content: "";
top: -1px;
right: -1px;
bottom: -1px;
left: -1px;
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
z-index: -1;
border-radius: $grid-unit-05;
top: calc(var(--wp-admin-border-width-focus) + 1px);
right: var(--wp-admin-border-width-focus);
bottom: var(--wp-admin-border-width-focus);
left: var(--wp-admin-border-width-focus);
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
border-radius: $radius-block-ui;
}
}
.dataviews-view-list__primary-field {
Expand All @@ -472,11 +457,11 @@
.dataviews-view-list__media-wrapper {
width: $grid-unit-50;
height: $grid-unit-50;
border-radius: $grid-unit-05;
overflow: hidden;
position: relative;
flex-shrink: 0;
background-color: $gray-100;
border-radius: $grid-unit-05;

img {
width: 100%;
Expand Down