sidebar and navbar have dark logo when dark mode is disabled

Open
#13,020 1 comment 0 reactions 1 assignee View on GitHub

@gordonwoodhull is already working on this.

Since Jul 1, 2025.

Assessment

This issue has not been assessed yet.

Description

brand bug dark-mode themes

In PR #12996, implementing #12981 dark theme enables dark brand along with light and dark logo, I seem to have painted myself into a corner and created a harmless but still glaring bug for anyone who looks at the HTML output.

That PR changes the signature of resolveBrand() to return light and dark brand as before, but now it always returns both and a flag enablesDarkMode.

This is because we don't know until mergeFormatData() in resolveFormats() whether light and dark themes are specified, to know whether we need to enable the dark brand.

At that point we have combined the project metadata, document metadata, and crucially, we've also combined things like

format:
  html:
    theme:
      light: ...
      dark: ...

Since the sidebar and navbar are initialized before any documents, they still have to use resolveBrand() instead of the resolved format.render.brand

This manifests as an invisible .dark-content logo in the sidebar or navbar when dark mode is not enabled. Maybe it would be possible to resolve format.html.theme and do a mini mergeConfigs on the project metadata to fix this?

Originally posted by @gordonwoodhull in https://github.com/quarto-dev/quarto-cli/issues/12996#issuecomment-3019843781

To be clear, we do have access to the project metadata when running project.resolveBrand(), it's just that it hasn't been normalized and merged.

So there are two questions:

  • can we resolve the project metadata in a robust way during project.resolveBrand(), enough to know whether there is a dark theme?
  • does it matter that a document could conceivably enable (or disable) dark mode through document theme settings, or do we have to also merge the document metadata during project.resolveBrand() to know whether dark mode is enabled. (Reminiscent of #11309.)
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quarto-dev/quarto-cli

All issues in quarto-dev/quarto-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.