-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Data views: Unbox items in grid layout #61159
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -20 B (0%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
For me this PR felt good for patterns and pages but in templates, it felt too crowded for some reason. I wonder if increasing the gap between items would help. |
I agree, but it might be best to look at this more broadly. In a separate PR I'd like to explore tweaking the spacing based on the page container width. In narrow layouts (List) the spacing is a little too much, and it's the opposite in wider layouts (Grid / Table). |
Before: After: This works for me. cc @richtabor @jasmussen for other opinions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I think it works. There's something about those screenshots being vertically centered that feels awkward, though — that's separate. I do also wonder if the gap between these should be slightly bigger — density is good, but a little whitespace can help also. |
Indeed, it seems to be an issue in trunk too but yeah, should definitely be top aligned IMO |
I go back and forth a bit on this... for patterns I find the top alignment a little strange sometimes: It's also interesting that the templates and patterns pages have different alignments, unsure how we ended up there... :) As with most visual details in data views, it's difficult to find a single solution that works best for all consumers. A configuration option like #60891 can help. |
Could we differentiate between patterns and pages/posts/templates, and assign a min-height (or |
Although I love the masonry, there are some challenges with making that work consistently, so I'm not necessarily proposing that. But to your suggestion, and a question, can we:
Let me know if that makes sense and is feasible. Happy to chat if the idea needs more clarification. |
Yup, I'll make a PR to explore options when I get a second. |
#61190 fixes the alignment, so this should be good to go. I'll merge, but we can keep refining as needed. |
&::after { | ||
content: ""; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
box-shadow: inset 0 0 0 $border-width rgba(0, 0, 0, 0.1); | ||
border-radius: $grid-unit-05; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps due to this pseudo-element, the clickable area in the pattern preview is limited to the actual content.
Can one of the following approaches solve the problem?
.dataviews-view-grid .dataviews-view-grid__media:after
: Addpointer-envents: none
.page-patterns-preview-field__button
: Addz-index: 1
ed9c39e3a07caa35f39a02c25fe69a44.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot, and suggestion. I'll work on a follow-up.
Recently-added field display options (badge, row / column) and other tweaks like decreasing checkbox size improve information density in grid layout, thereby alleviating the need to visually stress the grid structure.
In this PR the 'box' around each grid item is removed giving the overall layout more room to breath.
Before
After
Testing instructions