Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/resources/filters/quarto-post/typst-brand-yaml.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,13 @@ function render_typst_brand_yaml()
end

local link = _quarto.modules.brand.get_typography('link')
if link and next(link) then
local primaryColor = _quarto.modules.brand.get_color('primary')
if link and next(link) or primaryColor then
link = link or {}
quarto.doc.include_text('in-header', table.concat({
'#show link: set text(',
conditional_entry('weight', link.weight),
conditional_entry('fill', link.color, false),
conditional_entry('fill', link.color or primaryColor, false),
')'
}))
end
Expand Down Expand Up @@ -304,15 +306,16 @@ function render_typst_brand_yaml()
end

local headings = _quarto.modules.brand.get_typography('headings')
if headings and next(headings) or _quarto.modules.brand.get_color('foreground') then
local foregroundColor = _quarto.modules.brand.get_color('foreground')
if headings and next(headings) or foregroundColor then
base = base or {}
headings = headings or {}
meta.brand.typography.headings = {
family = headings.family or base.family,
weight = headings.weight or base.weight,
style = headings.style or base.style,
decoration = headings.decoration or base.decoration,
color = headings.color or _quarto.modules.brand.get_color('foreground'),
color = headings.color or foregroundColor,
['background-color'] = headings['background-color'] or base['background-color'],
['line-height'] = line_height_to_leading(headings['line-height'] or base['line-height']),
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Foreground and background colors
format:
typst:
keep-typ: true
brand:
color:
palette:
fire: "#dd571c"
primary: fire

_quarto:
tests:
typst:
ensurePdfRegexMatches:
-
- 'a link in rgb\("#dd571c"\)'
- []
---

Here is [a link in `#context text.fill`{=typst}](http://example.com).
Loading