Skip to content

Commit 2ef5b3d

Browse files
add respect-user-color-scheme-example
update ref remove language about it not being dynamic, due to quarto-dev/quarto-cli#12465
1 parent c31104e commit 2ef5b3d

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

docs/output-formats/html-themes.qmd

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,19 @@ Setting the above themes in your `_quarto.yml` results in both a dark and light
101101

102102
When providing both a dark and light mode for your html output, Quarto will automatically create a toggle to allow your reader to select the desired dark or light appearance. The toggle will automatically appear in the top right corner of your html output. When possible, the toggle will use browser local storage to maintain the user's preference across sessions.
103103

104-
To honor the user's operating system or browser preference for light or dark mode, specify `respect-user-color-scheme: true`. Otherwise, the order of light and dark elements in the theme or brand will determine the default appearance for your html output. For example, since the `light` option appears first in the above example, a reader will see the light appearance by default, if `respect-user-color-scheme` is not enabled.
104+
To honor the user's operating system or browser preference for light or dark mode, specify `respect-user-color-scheme: true`:
105+
106+
``` yaml
107+
format:
108+
html:
109+
respect-user-color-scheme: true
110+
```
111+
112+
Otherwise, the order of light and dark elements in the theme or brand will determine the default appearance for your html output. For example, since the `light` option appears first in the first example, a reader will see the light appearance by default, if `respect-user-color-scheme` is not enabled.
105113

106114
Quarto will automatically select the appropriate light or dark version of the text highlighter that you have specified when possible. For more information, see [Code Highlighting](html-code.qmd#highlighting).
107115

108-
As of Quarto 1.7, `respect-user-color-scheme` applies on page load, and the page won't change if dark mode is changed dynamically. It also requires JavaScript support: users with JavaScript disabled will see the author-preferred (first) brand or theme.
116+
As of Quarto 1.7, `respect-user-color-scheme` requires JavaScript support: users with JavaScript disabled will see the author-preferred (first) brand or theme.
109117

110118
### Customizing Themes
111119

0 commit comments

Comments
 (0)