Grid support enhancements
This issue is for grouping grid features requests and bugs.
If you’d like to have a new feature regarding grid properties or encounter an issue related to grid, you can check here if an issue isn’t already opened. If not, please open an issue and we’ll link it there :)
- [x]
grid-auto-flow: column− #2142 - [x] fragmentation in rows and
break-inside: avoidfor grid items – #2397 - [x]
break-inside: avoidfor grid containers – #2397 - [x] display at least one row on empty pages - c10c6892
- [ ] auto content size for grid containers – #2354
- [ ]
display: inline-grid - [ ] subgrids
- [ ]
repeat(auto-fill, *)andrepeat(auto-fit, *) - [ ]
automargins for grid items - [ ]
spanwith line names - [ ]
spanfor flexible tracks - [ ]
safeandunsafealignments - [ ] baseline alignment
- [ ] grid items with intrinsic size (images)
- [ ] distribute space beyond limits
- [ ] grid items larger than grid containers
- [ ]
min-width,max-width,min-height,max-heighton grid items - [ ] complex
min-contentandmax-contentcases - [ ] absolutely positioned and floating grid items
- [ ]
break-beforeandbreak-afterfor grid items
Great to see this list! One clarification to see if this relates to a problem I've noticed:
auto content size for grid containers
Does this mean that, for example, rows within a display: grid container layout would automatically resize their height to fit the size of their content? If so, then I can file a more specific issue to detail the behavior I'm looking for because this doesn't work now.
(My usual process is to get something working in Chrome, and then compare to the output of Weasyprint; Chrome is more forgiving but I want to make sure I can point to specific issues where possible).
Thanks for all your work on this!
Does this mean that, for example, rows within a
display: gridcontainer layout would automatically resize their height to fit the size of their content?
No, it means for example that a grid can’t find the maximum width of its content. Here’s an example:
<div style="float: left">
<div style="display: grid; grid: 1fr / 1fr 1fr; border: 1px solid red">
<div>abc def</div>
<div>abc def</div>
</div>
</div>
In this example, we have one row with two columns with "abc def", so its maximum width is the width of "abc defabc def". WeasyPrint can’t find this width yet, it assumes that it is the width of "abc def", just as if it was a block containing other blocks.
If so, then I can file a more specific issue to detail the behavior I'm looking for because this doesn't work now.
Yes, you can open another issue, and give us an example so that we can reproduce the problem.