Closed (fixed)
Project:
Drupal core
Version:
10.0.x-dev
Component:
Olivero theme
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Dec 2021 at 22:38 UTC
Updated:
5 Jan 2022 at 18:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mherchelThis patch removes SOOO MUCH CRUFTY CODE!!!
The new implementation sets a minimum width (we hard code this to 100px). The columns will span the specified number, but when the browser is resized and the columns get smaller, grid items will automatically reflow when the minimum width is reached. It's automagical and done without media queries!
Comment #3
mherchelTugboat preview: https://3255180-refactor-views-grid-sbdpg6igpnotxckuw6zsh7m2fqz5anx8.tug...
To demo the CSS custom properties, change the
--views-grid--column-countin devtools to see how it interacts at various breakpoints. Note that we have the minimum column size hard coded to 100px (so column widths will not go any smaller than that).Comment #4
gauravvvv commentedI have tested this on live preview
Minimum width of columns is now set to 100px.
In mobile devices below 490px, we can see there are three columns in a row (because of min-width: 100px for columns).
Attached screen-recording for same.
Code changes are looking good & tests are passing.
Can be moved to RTBC.
Comment #5
mherchelRTBC per previous comment
Comment #7
mherchelCouple fixes in this patch:
auto-fillinstead ofauto-fit. This ensures that a small number of views results will not take up a full row. They will only take up their respective columns.Leaving RTBC per @lauriii. Also crediting @andy-blum who suggested the auto-fill change.
Tugboat URL:
Edit. The patch filenames should have a "7" at the end. I messed up the comment number.
Comment #9
lauriiiEpic work on this! 👏 This simplifies the code by so much, and also paves a path forward to the Views grid actually being a really powerful tool! I noticed that for example, even the the Media Library in core isn't using Views grids for rendering their grids. I think we should make it a goal to make the Media Library Views use the grid once we have been able to do this change in other core themes 🤑
Committed 96c04f4 and pushed to 10.0.x. Thanks!