`respect-user-color-scheme: true` does not follow system theme dynamically
@cderv is already working on this.
Since May 27, 2026.
Assessment
This issue has not been assessed yet.
Description
When respect-user-color-scheme: true is set in a Quarto HTML document, the
page respects the user's OS-level light/dark preference at load time, but does
not follow it when the OS theme changes while the page is open. This
behaviour is described in #12426 but I believe is no longer needed, and the
expected behaviour for most users setting respect-user-color-scheme: true
would be for the document to follow the system theme anytime it changes.
Quarto version
Quarto 1.9.37
[✓] Checking environment information...
Quarto cache location: /home/coy/.cache/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.8.3: OK
Dart Sass version 1.87.0: OK
Deno version 2.4.5: OK
Typst version 0.14.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.9.37
Path: /opt/quarto/bin
[✓] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
Chrome Headless Shell: (not installed)
VeraPDF: (not installed)
[✓] Checking LaTeX....................OK
Using: Installation From Path
Path: /home/coy/texlive/2023/bin/x86_64-linux
Version: 2023
[✓] Checking Chrome Headless....................OK
Chrome: (not detected)
[✓] Checking basic markdown render....OK
[✓] Checking R installation...........OK
Version: 4.5.3
Path: /usr/lib/R
LibPaths:
- /home/coy/R/x86_64-pc-linux-gnu-library/4.5
- /usr/local/lib/R/site-library
- /usr/lib/R/site-library
- /usr/lib/R/library
knitr: 1.51
rmarkdown: 2.31
[✓] Checking Knitr engine render......OK
[✓] Checking Python 3 installation....OK
Version: 3.13.5
Path: /usr/bin/python3
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with python3 -m pip install jupyter
[✓] Checking Julia installation...
Steps to reproduce
This minimal example shows the described behavior. With changes made in #14552 the rendered document follows what's described in it.
---
title: "Follow System Theme Test"
format:
html:
theme:
light: flatly
dark: darkly
respect-user-color-scheme: true
---
## Test
This document uses `respect-user-color-scheme: true` with light/dark themes.
- The page should start in the theme matching your OS preference.
- The toggle button (top right or navbar) should switch themes.
- When you change your OS theme (system settings → dark/light), the page
should follow automatically.
- After manually toggling, the page should remember your choice, but if the
OS theme changes, the override should expire and the page should follow
the system again.
Open your OS theme settings (or use Developer Tools → Rendering → Emulate
CSS media feature prefers-color-scheme) to test.
<!-- Content-visible blocks: .light-content shows only in light mode,
.dark-content shows only in dark mode. These verify that theme
switching still works correctly when following the system. -->
:::{.callout-note .light-content}
## Light-only note
This callout is only visible when the page is in **light mode**.
It should appear/disappear as the system theme changes.
:::
:::{.callout-warning .dark-content}
## Dark-only warning
This callout is only visible when the page is in **dark mode**.
It should appear/disappear as the system theme changes.
:::
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from quarto-dev/quarto-cli
-
binder bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
quarto-dev/quarto-cli#14907 · 3 comments ·
-
brand bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
quarto-dev/quarto-cli#14891 ·
-
brand bug html revealjs
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
quarto-dev/quarto-cli#14882 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
quarto-dev/quarto-cli#14875 ·
-
Percent scripts: accept raw-string (r""") and '''-delimited markdown cells, as jupytext writes them Openengines-jupyter enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
quarto-dev/quarto-cli#14850 · 2 comments ·
All issues in quarto-dev/quarto-cli
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
babalae/bettergi-scripts-list#3674 ·
-
ecosystem wording
Difficulty 1/5 Under an hour Newbie friendliness 90/100
matrix-org/matrix.org#3649 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
vadimdemedes/ink#1029 ·
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·