summaryrefslogtreecommitdiff
path: root/tests/typ/elements/rect.typ
blob: 59dd4ee0bc9ba2bd6486189b361976476cc6695d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Test the `rect` function.

---
// Default rectangle.
#rect()

---
#page(width: 150pt)

// Fit to text.
#rect(fill: conifer)[Textbox]

// Empty with fixed width and height.
#rect(width: 3cm, height: 12pt, fill: rgb("ed8a4c"))

// 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]

// These are inline with text.
\{#rect(width: 0.5in, height: 7pt, fill: rgb("d6cd67"))
  #rect(width: 0.5in, height: 7pt, fill: rgb("edd466"))
  #rect(width: 0.5in, height: 7pt, fill: rgb("e3be62"))\}