Skip to content

Commit 58c5d0e

Browse files
use lightened colors for brand background colors
fixes #11485
1 parent f82973f commit 58c5d0e

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ function render_typst_brand_yaml()
7070
end
7171
local decl = '#let brand-color = ' .. to_typst_dict_indent(colors)
7272
quarto.doc.include_text('in-header', decl)
73-
local BACKGROUND_OPACITY = 0.1
74-
local themebk = {}
75-
for name, _ in pairs(brandColor) do
76-
themebk[name] = _quarto.modules.brand.get_background_color(name, BACKGROUND_OPACITY)
77-
end
7873
if brandColor.background then
7974
quarto.doc.include_text('in-header', '#set page(fill: brand-color.background)')
8075
end
@@ -84,7 +79,11 @@ function render_typst_brand_yaml()
8479
quarto.doc.include_text('in-header', '#set line(stroke: (paint: brand-color.foreground))')
8580

8681
end
87-
local decl = '// theme colors at opacity ' .. BACKGROUND_OPACITY .. '\n#let brand-color-background = ' .. to_typst_dict_indent(themebk)
82+
local themebk = {}
83+
for name, _ in pairs(brandColor) do
84+
themebk[name] = 'brand-color.' .. name .. '.lighten(85%)'
85+
end
86+
local decl = '#let brand-color-background = ' .. to_typst_dict_indent(themebk)
8887
quarto.doc.include_text('in-header', decl)
8988
end
9089
local function conditional_entry(key, value, quote_strings)

tests/docs/smoke-all/typst/brand-yaml/color/posit/brand-color.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ _quarto:
1010
-
1111
- 'burgundy: rgb\("#9a4665"\),'
1212
- 'primary: rgb\("#447099"\),'
13-
- 'primary: rgb\("#44709919"\),' # background
13+
- 'primary: brand-color\.primary\.lighten\(85%\),'
1414
- 'title: (\r\n?|\n)\[(\r\n?|\n)Note(\r\n?|\n)\](\r\n?|\n), (\r\n?|\n)background_color: (\r\n?|\n)brand-color-background.primary'
1515
- 'title: (\r\n?|\n)\[(\r\n?|\n)Warning(\r\n?|\n)\](\r\n?|\n), (\r\n?|\n)background_color: (\r\n?|\n)brand-color-background.warning'
1616
-

0 commit comments

Comments
 (0)