diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-07 14:30:50 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-07 14:43:13 +0100 |
| commit | 0a41844cc4e645e87fe48aa31ed3a4fd40a6ab11 (patch) | |
| tree | c7cac97079491c8a11afae1211d7a80415fe64ef /tests/typ | |
| parent | efd1853d069fbd1476e82d015da4d0d04cfaccc0 (diff) | |
Selectors
Diffstat (limited to 'tests/typ')
| -rw-r--r-- | tests/typ/style/show-bare.typ | 2 | ||||
| -rw-r--r-- | tests/typ/style/show-node.typ | 2 | ||||
| -rw-r--r-- | tests/typ/style/show-selector.typ | 36 |
3 files changed, 38 insertions, 2 deletions
diff --git a/tests/typ/style/show-bare.typ b/tests/typ/style/show-bare.typ index 2dba742f..8b8d0852 100644 --- a/tests/typ/style/show-bare.typ +++ b/tests/typ/style/show-bare.typ @@ -1,4 +1,4 @@ -// Test bare show without pattern. +// Test bare show without selector. --- #set page(height: 130pt) diff --git a/tests/typ/style/show-node.typ b/tests/typ/style/show-node.typ index 56b7e34a..e552038d 100644 --- a/tests/typ/style/show-node.typ +++ b/tests/typ/style/show-node.typ @@ -94,7 +94,7 @@ Another text. = Heading --- -// Error: 7-10 expected function, string or regular expression, found color +// Error: 7-10 expected selector, found color #show red: [] --- diff --git a/tests/typ/style/show-selector.typ b/tests/typ/style/show-selector.typ new file mode 100644 index 00000000..dc88d395 --- /dev/null +++ b/tests/typ/style/show-selector.typ @@ -0,0 +1,36 @@ +// Test show rule patterns. + +--- +// Inline code. +#show raw.where(block: false): rect.with( + radius: 2pt, + outset: (y: 3pt), + inset: (x: 3pt), + fill: luma(230), +) + +// Code blocks. +#show raw.where(block: true): rect.with( + outset: -3pt, + inset: 11pt, + fill: luma(230), + stroke: (left: 1.5pt + luma(180)), +) + +#set page(margins: (top: 12pt)) +#set par(justify: true) + +This code tests `code` +with selectors and justification. + +```rs +code!("it"); +``` + +--- +#show heading.where(level: 1): text.with(red) +#show heading.where(level: 2): text.with(blue) +#show heading: text.with(green) += Red +== Blue +=== Green |
