Repository navigation
Lay out cells in a grid of equal columns - #101
Merged
Merged
Conversation
document.grid(columns: 3, gap: [16, 12]) puts its cells side by side, columns to a line, all as wide, the last line's included. A line is as high as its tallest cell and moves whole to the next page; pages break between lines. Cell widths and grow raise, a cell kept with the next keeps its line with the next one, and a grid with a background, a border or keep_together moves whole like a stack. Assisted-by: Claude [Claude Code]
A cell with a background or a border reaches down to the bottom of its line, like a CSS grid's, so cards side by side line up. Assisted-by: Claude [Claude Code]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cards, catalogues and blocks of addresses side by side needed a row per line and widths computed by hand, and the last, shorter line came out with wider cells than the others. Part of #71.
grid(columns:)puts its cellscolumnsto a line, all as wide, the last line's included. It is a box like the others, on the document or in a stack or a row.gapis one number, or[between lines, between columns].keep_with_nextkeeps its line with the next one, a heading in a cell for instance.columnsthat is not a positive integer, a cell'swidthorgrow, and gaps wider than the grid. Padding, background, border andkeep_togetherwork as on a stack.Proof
test/native_grid_test.rbcovers column positions, both gaps, line height, stretched decorations, page breaks between lines,keep_with_next, a decorated grid, a grid in a row, and the errors. The contract lists#gridon the document and on containers. A 40-card catalogue runs over two pages with whole lines and cards of equal height, andqpdf --checkpasses.rake test: 1333 runs, 0 failures; RuboCop is clean.