From d0e3734f304433c736558e114f72195f5e750c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gir=C3=A3o=20Serr=C3=A3o?= <5621605+rodrigogiraoserrao@users.noreply.github.com> Date: Mon, 19 Dec 2022 18:02:40 +0000 Subject: [PATCH] Complete reference for grid-rows. --- docs/styles/grid/grid_rows.md | 60 +++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/docs/styles/grid/grid_rows.md b/docs/styles/grid/grid_rows.md index 34bfd043c..a71175c0d 100644 --- a/docs/styles/grid/grid_rows.md +++ b/docs/styles/grid/grid_rows.md @@ -1 +1,61 @@ # Grid-rows + +The `grid-rows` style allows to define the height of the rows of the grid. + +## Syntax + +```sass +grid-rows: . . .; +``` + +If there are more rows in the grid than scalars specified in `grid-rows`, they are reused cyclically. + +Scalar units can be mixed. + +--8<-- "docs/styles/snippets/scalar_syntax.md" + +## Example + +The example below shows a grid with 10 labels laid out in a grid with 5 rows and 2 columns. + +We set `grid-rows: 1fr 6 25%`. +Because there are more rows than scalars in the style rule, the scalars will be reused: + + - rows 1 and 4 have height `1fr`; + - rows 2 and 5 have height `6`; and + - row 3 has height `25%`. + + +=== "Output" + + ```{.textual path="docs/examples/styles/grid_rows.py"} + ``` + +=== "grid_rows.py" + + ```py + --8<-- "docs/examples/styles/grid_rows.py" + ``` + +=== "grid_rows.css" + + ```css + --8<-- "docs/examples/styles/grid_rows.css" + ``` + +## CSS + +```sass +/* Set all rows to have 50% height */ +grid-rows: 50%; + +/* Every other row is twice as tall as the first one */ +grid-rows: 1fr 2fr; +``` + +### Python + +```py +grid.styles.grid_rows = "50%" +grid.styles.grid_rows = "1fr 2fr" +```