typst/tests/typ/insert/rect.typ
Laurenz 594809e35b Library functions behave more imperatively
- Templates scope state changes
- State-modifying function operate in place instead of returning a template
- Internal template representation contains actual owned nodes instead of a pointer to a syntax tree + an expression map
- No more wide calls
2021-08-17 22:20:37 +02:00

28 lines
720 B
XML

// Test shapes.
---
// Test the `rect` function.
#page(width: 150pt)
// Fit to text.
#rect(fill: conifer)[Textbox]
// Empty with fixed width and height.
#rect(width: 3cm, height: 12pt, fill: rgb("CB4CED"))
// Fixed width, text height.
#rect(width: 2cm, fill: rgb("9650D6"), pad(5pt)[Fixed and padded])
// Page width, fixed height.
#rect(height: 1cm, width: 100%, fill: rgb("734CED"))[Topleft]
// Not visible, but creates a gap between the boxes above and below
// due to line spacing.
#rect(width: 1in, fill: rgb("ff0000"))
// These are in a row!
#rect(width: 0.5in, height: 10pt, fill: rgb("D6CD67"))
#rect(width: 0.5in, height: 10pt, fill: rgb("EDD466"))
#rect(width: 0.5in, height: 10pt, fill: rgb("E3BE62"))