Skip to content

Commit 852567d

Browse files
authored
Merge pull request #12996 from quarto-dev/feature/dark-logo
feature: light and dark logo
2 parents 3c867fa + 4548ac1 commit 852567d

File tree

140 files changed

+2378
-293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+2378
-293
lines changed

news/changelog-1.8.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ All changes included in 1.8:
2020
- ([#5538](https://github.com/quarto-dev/quarto-cli/issues/5538)): Fix code-copy button style so that scrolling behaves properly.
2121
- ([#10983](https://github.com/quarto-dev/quarto-cli/issues/10983)): Fix spacing inconsistency between paras and first section headings.
2222
- ([#12259](https://github.com/quarto-dev/quarto-cli/issues/12259)): Fix conflict between `html-math-method: katex` and crossref popups (author: @benkeks).
23+
- ([#12341](https://github.com/quarto-dev/quarto-cli/issues/12341)): Enable light and dark logos for html formats (sidebar, navbar, dashboard).
2324
- ([#12734](https://github.com/quarto-dev/quarto-cli/issues/12734)): `highlight-style` now correctly supports setting a different `light` and `dark`.
2425
- ([#12747](https://github.com/quarto-dev/quarto-cli/issues/12747)): Ensure `th` elements are properly restored when Quarto's HTML table processing is happening.
2526
- ([#12766](https://github.com/quarto-dev/quarto-cli/issues/12766)): Use consistent equation numbering display for `html-math-method` and `html-math-method.method` for MathJax and KaTeX (author: @mcanouil)
2627
- ([#12797](https://github.com/quarto-dev/quarto-cli/issues/12797)): Allow light and dark brands to be specified in one file, by specializing colors with `light:` and `dark:`.
2728
- ([#12919](https://github.com/quarto-dev/quarto-cli/issues/12919)): Ensure `kbd` shortcode output has hover tooltip.
29+
- ([#12981](https://github.com/quarto-dev/quarto-cli/issues/12981)): Brand should be applied in dark mode when dark mode is enabled by the theme, not the brand.
2830

2931
### `revealjs`
3032

src/command/render/render-contexts.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ import {
8686
import { ExtensionContext } from "../../extension/types.ts";
8787
import { NotebookContext } from "../../render/notebook/notebook-types.ts";
8888
import { safeCloneDeep } from "../../core/safe-clone-deep.ts";
89+
import { darkModeDefaultMetadata } from "../../format/html/format-html-info.ts";
8990

9091
export async function resolveFormatsFromMetadata(
9192
metadata: Metadata,
@@ -569,8 +570,16 @@ async function resolveFormats(
569570

570571
// resolve brand in project and forward it to format
571572
const brand = await project.resolveBrand(target.source);
572-
mergedFormats[format].render.brand = brand;
573-
573+
if (brand) {
574+
mergedFormats[format].render.brand = {
575+
light: brand.light,
576+
dark: (brand.enablesDarkMode ||
577+
darkModeDefaultMetadata(mergedFormats[format].metadata) !==
578+
undefined)
579+
? brand.dark
580+
: undefined,
581+
};
582+
}
574583
// apply defaults from brand yaml under the metadata of the current format
575584
const brandFormatDefaults: Metadata =
576585
(brand?.light?.data?.defaults?.quarto as unknown as Record<

0 commit comments

Comments
 (0)