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

Fix grid layout padding on small screens #64878

Merged
merged 5 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion packages/dataviews/src/components/dataviews/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
padding: $grid-unit-15 $grid-unit-30;
}

.dataviews-view-grid,
.dataviews-no-results,
.dataviews-loading {
padding-left: $grid-unit-30;
Expand Down
8 changes: 8 additions & 0 deletions packages/dataviews/src/dataviews-layouts/grid/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,11 @@
.dataviews-view-grid__card.is-selected .dataviews-selection-checkbox {
top: $grid-unit-10;
}

/* stylelint-disable-next-line scss/at-rule-no-unknown -- '@container' not globally permitted */
@container (max-width: 430px) {
Copy link
Contributor

Choose a reason for hiding this comment

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

PR as a whole works for me. But this is new! I wonder:

  • Should we have a system for these widths? Some variables we define and then use, just like we have modal preset sizes, so arbitrary fix-widths don't propogate?
  • Do we need a fallback? Support is generally good, so probably not, but worth pondering.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Potentially yes. Another approach would be to restructure the Page component a bit so that the behavior is built into the region that displays page content, with props to disable. That is a bigger discussion.

.dataviews-view-grid {
padding-left: $grid-unit-30;
padding-right: $grid-unit-30;
}
}
Loading