diff --git a/src/resources/filters/quarto-post/typst-brand-yaml.lua b/src/resources/filters/quarto-post/typst-brand-yaml.lua index 874e5679ed5..d0c51841864 100644 --- a/src/resources/filters/quarto-post/typst-brand-yaml.lua +++ b/src/resources/filters/quarto-post/typst-brand-yaml.lua @@ -301,14 +301,15 @@ function render_typst_brand_yaml() end local headings = _quarto.modules.brand.get_typography('headings') - if headings and next(headings) then + if headings and next(headings) or _quarto.modules.brand.get_color('foreground') 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 base.color, + color = headings.color or _quarto.modules.brand.get_color('foreground'), ['background-color'] = headings['background-color'] or base['background-color'], ['line-height'] = line_height_to_leading(headings['line-height'] or base['line-height']), } diff --git a/tests/docs/smoke-all/typst/brand-yaml/color/foreground-background.qmd b/tests/docs/smoke-all/typst/brand-yaml/color/foreground-background.qmd new file mode 100644 index 00000000000..b379e88ad0d --- /dev/null +++ b/tests/docs/smoke-all/typst/brand-yaml/color/foreground-background.qmd @@ -0,0 +1,36 @@ +--- +title: Foreground and background colors +format: + typst: + keep-typ: true +brand: + color: + foreground: "#ccd2b2" + background: "#0d0519" + typography: + monospace-block: + background-color: "#ccd2b250" + +_quarto: + tests: + typst: + ensureTypstFileRegexMatches: + - + - '#set page\(fill: brand-color\.background\)' + - '#set text\(fill: brand-color\.foreground\)' + - 'heading-color: unescape-eval\("rgb\(\\"\\#ccd2b2\\"\)"\)' + - [] +--- + +# Just double checking... + +That simple background and foreground colors work everywhere. + +Here is some `inline code`. + +``` +You are going to need to customize +your code blocks for dark mode! +``` + +{{< lipsum 2 >}}