useful and new example on subgrids with documentation example #13460
Thibaultfq
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
To leverage the subgrid utility in css (which came in tailwind 3.4), documentation on this feature can be expanded.
In fact, it can actually be used to address problems that have long been difficult or impossible to achieve using css only.
One example is to create a grid where sibling cells per row have the same or equal (minimum) height. This way, they start on at the same height in the grid. Problem definition is described in detail here: https://stackoverflow.com/questions/46816752/equal-height-of-elements-inside-grid-item-with-css-grid-layout/78281657#78281657
often, the 'cards' or blocks in such grid are created using a loop and their block of content have a dynamic height based on their (dynamic) contents (e.g. 1-3 sentences per header, body and footer). Having them start at the same height is nice, but before subgrid we couldn't style elements based on properties (height) is siblings.
The solution to this using subgrid in tailwind: https://play.tailwindcss.com/1e7mvOHZaC
Beta Was this translation helpful? Give feedback.
All reactions