From 474211db4b233df9395ad88de1a5ee21713ccedc Mon Sep 17 00:00:00 2001 From: Gordon Woodhull Date: Wed, 2 Apr 2025 18:28:36 -0400 Subject: [PATCH] brand short code light dark test for #12365 this was not a pure refactor; it did introduce another parameter to the brand color shortcode at shortcode time there is no user or auther preference, this just defaults to light --- news/changelog-1.7.md | 1 + tests/docs/shortcodes/brand-light-dark.qmd | 38 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 tests/docs/shortcodes/brand-light-dark.qmd diff --git a/news/changelog-1.7.md b/news/changelog-1.7.md index 26e8b7d9083..8fb9895cc7f 100644 --- a/news/changelog-1.7.md +++ b/news/changelog-1.7.md @@ -120,6 +120,7 @@ All changes included in 1.7: - ([#11896](https://github.com/quarto-dev/quarto-cli/pull/11896)): fix `\f` (`{{< pagebreak >}}`) form feed character not valid in PowerPoint (`pptx`). - ([#11664](https://github.com/quarto-dev/quarto-cli/issues/11664)): `lipsum` shortcode is no longer randomly generated by default, use `{{< lipsum random=true >}}` to restore randomness. - ([#11379](https://github.com/quarto-dev/quarto-cli/issues/11379)): Add `version` shortcode to display the current Quarto version. +- ([#12365](https://github.com/quarto-dev/quarto-cli/pull/12365)): `brand color` shortcode takes an optional `brandMode` second parameter, default `light`. - ([#12326](https://github.com/quarto-dev/quarto-cli/issues/12326)): Add `quarto.shortcode.*` API entry points for shortcode developers. ## Quarto Lua API diff --git a/tests/docs/shortcodes/brand-light-dark.qmd b/tests/docs/shortcodes/brand-light-dark.qmd new file mode 100644 index 00000000000..d3bde6f42bd --- /dev/null +++ b/tests/docs/shortcodes/brand-light-dark.qmd @@ -0,0 +1,38 @@ +--- +title: Test brand light/dark shortcodes +format: html +brand: + light: + color: + palette: + blue: "#82aeef" + background: '#fff8ee' + foreground: '#116423' + dark: + color: + palette: + blue: "#415777" + background: '#071217' + foreground: '#ffeecc' +_quarto: + tests: + html: + ensureHtmlElements: + - + - 'div#default-brand[style="background-color: #82aeef"]' + - 'div#light-brand[style="background-color: #82aeef"]' + - 'div#dark-brand[style="background-color: #415777"]' + - [] +--- + +::: {#default-brand style='background-color: {{< brand color blue >}}'} +Default brand blue background. +::: + +::: {#light-brand style='background-color: {{< brand color blue light >}}'} +Light brand blue background. +::: + +::: {#dark-brand style='background-color: {{< brand color blue dark >}}'} +Dark brand blue background. +:::