Skip to content

Commit

Permalink
typst brand yaml: lines take foreground color
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gordonwoodhull committed Nov 1, 2024
1 parent ffe274c commit e4e23ad
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/resources/filters/quarto-post/typst-brand-yaml.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ function render_typst_brand_yaml()
end
if brandColor.foreground then
quarto.doc.include_text('in-header', '#set text(fill: brand-color.foreground)')
quarto.doc.include_text('in-header', '#set table.hline(stroke: (paint: brand-color.foreground))')
quarto.doc.include_text('in-header', '#set line(stroke: (paint: brand-color.foreground))')

end
local decl = '// theme colors at opacity ' .. BACKGROUND_OPACITY .. '\n#let brand-color-background = ' .. to_typst_dict_indent(themebk)
quarto.doc.include_text('in-header', decl)
Expand Down
35 changes: 35 additions & 0 deletions tests/docs/smoke-all/typst/brand-yaml/color/foreground-lines.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: Foreground and background colors
format:
typst:
keep-typ: true
brand:
color:
foreground: "#ccd2b2"
background: "#30104f"

_quarto:
tests:
typst:
ensureTypstFileRegexMatches:
-
- '#set page\(fill: brand-color\.background\)'
- '#set text\(fill: brand-color\.foreground\)'
- 'heading-color: unescape-eval\("rgb\(\\"\\#ccd2b2\\"\)"\)'
- '#set table.hline\(stroke: \(paint: brand-color\.foreground\)\)'
- '#set line\(stroke: \(paint: brand-color\.foreground\)\)'

- []
---



| Col1 | Col2 |
|------|------|
| A | B |

------------------------------------------------------------------------

See footnote [^1]

[^1]: Here's a footnote

0 comments on commit e4e23ad

Please sign in to comment.