Skip to content

Commit bf1664b

Browse files
typst brand yaml: lines take foreground color
does not do #set table.vline(stroke: (paint: brand-color.foreground)) because we don't use vertical lines. but users can enable above if they need it
1 parent ffe274c commit bf1664b

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

src/resources/filters/quarto-post/typst-brand-yaml.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ function render_typst_brand_yaml()
7575
end
7676
if brandColor.foreground then
7777
quarto.doc.include_text('in-header', '#set text(fill: brand-color.foreground)')
78+
quarto.doc.include_text('in-header', '#set table.hline(stroke: (paint: brand-color.foreground))')
79+
quarto.doc.include_text('in-header', '#set line(stroke: (paint: brand-color.foreground))')
80+
7881
end
7982
local decl = '// theme colors at opacity ' .. BACKGROUND_OPACITY .. '\n#let brand-color-background = ' .. to_typst_dict_indent(themebk)
8083
quarto.doc.include_text('in-header', decl)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: Foreground and background colors
3+
format:
4+
typst:
5+
keep-typ: true
6+
brand:
7+
color:
8+
foreground: "#ccd2b2"
9+
background: "#30104f"
10+
11+
_quarto:
12+
tests:
13+
typst:
14+
ensureTypstFileRegexMatches:
15+
-
16+
- '#set page\(fill: brand-color\.background\)'
17+
- '#set text\(fill: brand-color\.foreground\)'
18+
- 'heading-color: unescape-eval\("rgb\(\\"\\#ccd2b2\\"\)"\)'
19+
- '#set table.hline\(stroke: \(paint: brand-color\.foreground\)\)'
20+
- '#set line\(stroke: \(paint: brand-color\.foreground\)\)'
21+
22+
- []
23+
---
24+
25+
26+
27+
| Col1 | Col2 |
28+
|------|------|
29+
| A | B |
30+
31+
------------------------------------------------------------------------
32+
33+
See footnote [^1]
34+
35+
[^1]: Here's a footnote

0 commit comments

Comments
 (0)