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

[Dataviews] Fix: Media item focus style is not visible on Grid. #67789

Merged
Merged
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
15 changes: 10 additions & 5 deletions packages/dataviews/src/dataviews-layouts/grid/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@
.dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value {
color: $gray-900;
}

.dataviews-view-grid__media::after {
background-color: rgba(var(--wp-admin-theme-color--rgb), 0.08);
box-shadow: inset 0 0 0 $border-width var(--wp-admin-theme-color);
}
}
&.is-selected .dataviews-view-grid__media::after,
Copy link
Member

Choose a reason for hiding this comment

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

It works for me, but I welcome feedback from design: in the grid view, do we need to distinguish from a "selected" state and from a "focused" state? (I presume this would be fine to tweak as a follow-up if necessary)

Selected Focused
Screenshot 2024-12-10 at 14 27 05 Screenshot 2024-12-10 at 14 27 01

cc @jameskoster

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the ping. The focus treatment should utilise the var(--wp-admin-border-width-focus) (1.5px) stroke width. The stroke for the selected item should be only 1px.

.dataviews-view-grid__media:focus::after {
background-color: rgba(var(--wp-admin-theme-color--rgb), 0.08);
}
&.is-selected .dataviews-view-grid__media::after {
box-shadow: inset 0 0 0 $border-width var(--wp-admin-theme-color);
}
.dataviews-view-grid__media:focus::after {
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
}
}

Expand Down
Loading