diff --git a/book-example/src/format/config.md b/book-example/src/format/config.md index 257a6db1..aacd40de 100644 --- a/book-example/src/format/config.md +++ b/book-example/src/format/config.md @@ -150,8 +150,10 @@ The following configuration options are available: files with the ones found in the specified folder. - **default-theme:** The theme color scheme to select by default in the 'Change Theme' dropdown. Defaults to `light`. -- **preferred-dark-theme:** The default theme to use if the browser - requests the dark version of the site. Defaults to `navy`. +- **preferred-dark-theme:** The default dark theme. This theme will be used if + the browser requests the dark version of the site via the + ['prefers-color-scheme'](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) + CSS media query. Defaults to the same theme as `default-theme`. - **curly-quotes:** Convert straight quotes to curly quotes, except for those that occur in code blocks and code spans. Defaults to `false`. - **mathjax-support:** Adds support for [MathJax](mathjax.md). Defaults to diff --git a/src/config.rs b/src/config.rs index 21b5452e..772a03a9 100644 --- a/src/config.rs +++ b/src/config.rs @@ -420,10 +420,8 @@ pub struct HtmlConfig { pub theme: Option, /// The default theme to use, defaults to 'light' pub default_theme: Option, - /// The default dark theme. - /// This theme will be used if the browser requests a dark theme - /// via the 'prefers-color-scheme' CSS media query. - /// Defaults to 'navy'. + /// The theme to use if the browser requests the dark version of the site. + /// Defaults to the same as 'default_theme' pub preferred_dark_theme: Option, /// Use "smart quotes" instead of the usual `"` character. pub curly_quotes: bool, diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs index e9f70225..b2b5e53b 100644 --- a/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/renderer/html_handlebars/hbs_renderer.rs @@ -409,7 +409,7 @@ fn make_data( let preferred_dark_theme = match html_config.preferred_dark_theme { Some(ref theme) => theme, - None => "navy", + None => default_theme, }; data.insert( "preferred_dark_theme".to_owned(),