summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-09-10 14:29:11 +0200
committerLaurenz <laurmaedje@gmail.com>2021-09-10 15:10:34 +0200
commitb0b4607725d55cc99c13986e14294e0da3e56e08 (patch)
tree26a4de1511ffcf8e0c36cfc371fae0eda6e82f01 /tests
parent50a464488cc811d7ec9ed2b2c8b1e8a580510e20 (diff)
Set the correct base for grid cells
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/layout/grid-4.pngbin0 -> 431 bytes
-rw-r--r--tests/typ/layout/grid-4.typ33
2 files changed, 33 insertions, 0 deletions
diff --git a/tests/ref/layout/grid-4.png b/tests/ref/layout/grid-4.png
new file mode 100644
index 00000000..a291658f
--- /dev/null
+++ b/tests/ref/layout/grid-4.png
Binary files differ
diff --git a/tests/typ/layout/grid-4.typ b/tests/typ/layout/grid-4.typ
new file mode 100644
index 00000000..02ac0486
--- /dev/null
+++ b/tests/typ/layout/grid-4.typ
@@ -0,0 +1,33 @@
+// Test relative sizing inside grids.
+
+---
+// Test that auto and linear columns use the correct base.
+#grid(
+ columns: (auto, 60%),
+ rows: (auto, auto),
+ rect(width: 50%, height: 0.5cm, fill: conifer),
+ rect(width: 100%, height: 0.5cm, fill: eastern),
+ rect(width: 50%, height: 0.5cm, fill: forest),
+)
+
+---
+// Test that fr columns use the correct base.
+#grid(
+ columns: (1fr,) * 4,
+ rows: (1cm,),
+ rect(width: 50%, height: 100%, fill: conifer),
+ rect(width: 50%, height: 100%, fill: forest),
+ rect(width: 50%, height: 100%, fill: conifer),
+ rect(width: 50%, height: 100%, fill: forest),
+)
+
+---
+// Test that all three kinds of rows use the correct bases.
+#page(height: 4cm, margins: 0cm)
+#grid(
+ rows: (1cm, 1fr, 1fr, auto),
+ rect(height: 50%, width: 100%, fill: conifer),
+ rect(height: 50%, width: 100%, fill: forest),
+ rect(height: 50%, width: 100%, fill: conifer),
+ rect(height: 25%, width: 100%, fill: forest),
+)