-
Notifications
You must be signed in to change notification settings - Fork 4.6k
DataViews: Fix grid padding values on mobile viewports #71455
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
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: +19 B (0%) Total Size: 1.92 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 64ecb40. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/17397015072
|
oandregal
left a comment
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.
Before:
Screen.Recording.2025-09-02.at.13.59.31.mov
After:
Screen.Recording.2025-09-02.at.13.58.39.mov
| * max-width. | ||
| */ | ||
| @container (max-width: 480px) { | ||
| @container (max-width: 430px) { |
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.
Oh interesting, I wonder why the discrepancy was introduced? I believe the 480px value was reached from some calculation based on the gutenberg media queries with the site editor sidebar width. I can't find any explanation for where the 430 value comes from but I see it's also used in edit-site.
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.
I couldn't find a reason. The container query originally had some grid related css in it, so maybe the styles were more focused on the gird.
What?
I noticed that the Grid layout in DataViews has some padding issues on mobile-ish viewports.
The Group By header has incorrect padding, since it's missing a container query.
I also noticed the container query that adjusts padding around the grid layout doesn't match the same values that the rest of DataViews uses.
The grid breaks at 480px, while DataViews components break at 430px. This can lead to a situation where the elements look misaligned. See:
gutenberg/packages/dataviews/src/components/dataviews/style.scss
Line 44 in 6938b0b
How?
Use 430px for the grid container queries.
Add a new container query for the group by header.
Testing Instructions
npm run storybook:devtrunkand you'll spot the inconsistencies.Screenshots or screencast
Before
After