diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-02-12 18:58:39 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-02-12 19:57:28 +0100 |
| commit | 3ffa7393f0632d9ee5dd9c821685a1a033d5c0ab (patch) | |
| tree | af09b0683352c4028436a2e5251dce54cf41d4aa /tests/typ/compiler | |
| parent | f4856c18b9cf3f6952276cc61b557aebeb2fa651 (diff) | |
Make all nodes block-level
Diffstat (limited to 'tests/typ/compiler')
| -rw-r--r-- | tests/typ/compiler/color.typ | 28 | ||||
| -rw-r--r-- | tests/typ/compiler/construct.typ | 2 | ||||
| -rw-r--r-- | tests/typ/compiler/show-node.typ | 2 | ||||
| -rw-r--r-- | tests/typ/compiler/show-selector.typ | 5 | ||||
| -rw-r--r-- | tests/typ/compiler/show-text.typ | 4 |
5 files changed, 23 insertions, 18 deletions
diff --git a/tests/typ/compiler/color.typ b/tests/typ/compiler/color.typ index 3b165d14..fbb1749b 100644 --- a/tests/typ/compiler/color.typ +++ b/tests/typ/compiler/color.typ @@ -1,22 +1,26 @@ // Test color modification methods. --- -// Test gray color modification. -#test(luma(20%).lighten(50%), luma(60%)) -#test(luma(80%).darken(20%), luma(63.9%)) -#test(luma(80%).negate(), luma(20%)) - ---- // Test CMYK color conversion. -// Ref: true #let c = cmyk(50%, 64%, 16%, 17%) -#rect(width: 1cm, fill: cmyk(69%, 11%, 69%, 41%)) -#rect(width: 1cm, fill: c) -#rect(width: 1cm, fill: c.negate()) +#stack( + dir: ltr, + spacing: 1fr, + rect(width: 1cm, fill: cmyk(69%, 11%, 69%, 41%)), + rect(width: 1cm, fill: c), + rect(width: 1cm, fill: c.negate()), +) #for x in range(0, 11) { - square(size: 9pt, fill: c.lighten(x * 10%)) + box(square(size: 9pt, fill: c.lighten(x * 10%))) } #for x in range(0, 11) { - square(size: 9pt, fill: c.darken(x * 10%)) + box(square(size: 9pt, fill: c.darken(x * 10%))) } + +--- +// Test gray color modification. +// Ref: false +#test(luma(20%).lighten(50%), luma(60%)) +#test(luma(80%).darken(20%), luma(63.9%)) +#test(luma(80%).negate(), luma(20%)) diff --git a/tests/typ/compiler/construct.typ b/tests/typ/compiler/construct.typ index 161827cb..53fcfefb 100644 --- a/tests/typ/compiler/construct.typ +++ b/tests/typ/compiler/construct.typ @@ -22,7 +22,7 @@ --- // The inner rectangle should not be yellow here. -A #rect(fill: yellow, inset: 5pt, rect()) B +A #box(rect(fill: yellow, inset: 5pt, rect())) B --- // The constructor property should still work diff --git a/tests/typ/compiler/show-node.typ b/tests/typ/compiler/show-node.typ index 4aba4e9b..f6298a28 100644 --- a/tests/typ/compiler/show-node.typ +++ b/tests/typ/compiler/show-node.typ @@ -28,7 +28,7 @@ my heading? // Test integrated example. #show heading: it => block({ set text(10pt) - move(dy: -1pt)[📖] + box(move(dy: -1pt)[📖]) h(5pt) if it.level == 1 { underline(text(1.25em, blue, it.title)) diff --git a/tests/typ/compiler/show-selector.typ b/tests/typ/compiler/show-selector.typ index 56e82769..ebd84837 100644 --- a/tests/typ/compiler/show-selector.typ +++ b/tests/typ/compiler/show-selector.typ @@ -2,12 +2,13 @@ --- // Inline code. -#show raw.where(block: false): rect.with( +#show raw.where(block: false): it => box(rect( radius: 2pt, outset: (y: 3pt), inset: (x: 3pt, y: 0pt), fill: luma(230), -) + it, +)) // Code blocks. #show raw.where(block: true): rect.with( diff --git a/tests/typ/compiler/show-text.typ b/tests/typ/compiler/show-text.typ index c867ff9f..e0fdb793 100644 --- a/tests/typ/compiler/show-text.typ +++ b/tests/typ/compiler/show-text.typ @@ -8,7 +8,7 @@ Die Zeitung Der Spiegel existiert. --- // Another classic example. -#show "TeX": [T#h(-0.145em)#move(dy: 0.233em)[E]#h(-0.135em)X] +#show "TeX": [T#h(-0.145em)#box(move(dy: 0.233em)[E])#h(-0.135em)X] #show regex("(Lua)?(La)?TeX"): name => box(text("Latin Modern Roman")[#name]) TeX, LaTeX, LuaTeX and LuaLaTeX! @@ -28,7 +28,7 @@ Treeworld, the World of worlds, is a world. --- // This is a fun one. #set par(justify: true) -#show regex("\S"): letter => rect(inset: 2pt)[#upper(letter)] +#show regex("\S"): letter => box(rect(inset: 2pt, upper(letter))) #lorem(5) --- |
