summaryrefslogtreecommitdiff
path: root/tests/typ/style/construct.typ
blob: f01b534b4214e7ec654752c04376f39d55610dda (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
26
27
28
29
30
31
32
33
// Test class construction.

---
// Ensure that constructor styles aren't passed down the tree.
// The inner list should have no extra indent.
#set par(leading: 2pt)
#list(
  body-indent: 20pt,
  [First],
  list([A], [B])
)

---
// Ensure that constructor styles win, but not over outer styles.
// The outer paragraph should be right-aligned,
// but the B should be center-aligned.
#set par(align: center)
#par(align: right)[
  A #rect(width: 2cm, fill: conifer, padding: 4pt)[B]
]

---
// The inner rectangle should also be yellow here.
// (and therefore invisible)
[#set rect(fill: yellow);#text(1em, rect(padding: 5pt, rect()))]

---
// The inner rectangle should not be yellow here.
A #rect(fill: yellow, padding: 5pt, rect()) B

---
// The inner list should not be indented extra.
[#set text(1em);#list(indent: 20pt, list[A])]