File tree 4 files changed +9
-3
lines changed
4 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ The following configuration options are available:
172
172
- ** preferred-dark-theme:** The default dark theme. This theme will be used if
173
173
the browser requests the dark version of the site via the
174
174
[ 'prefers-color-scheme'] ( https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme )
175
- CSS media query. Defaults to the same theme as ` default-theme ` .
175
+ CSS media query. Defaults to ` navy ` .
176
176
- ** curly-quotes:** Convert straight quotes to curly quotes, except for those
177
177
that occur in code blocks and code spans. Defaults to ` false ` .
178
178
- ** mathjax-support:** Adds support for [ MathJax] ( mathjax.md ) . Defaults to
Original file line number Diff line number Diff line change @@ -34,3 +34,9 @@ functionality. Therefore I recommend to use the file from the default theme as
34
34
template and only add / modify what you need. You can copy the default theme
35
35
into your source directory automatically by using ` mdbook init --theme ` just
36
36
remove the files you don't want to override.
37
+
38
+ If you completely replace all built-in themes, be sure to also set
39
+ [ ` output.html.preferred-dark-theme ` ] in the config, which defaults to the
40
+ built-in ` navy ` theme.
41
+
42
+ [ `output.html.preferred-dark-theme` ] : ../config.md#html-renderer-options
Original file line number Diff line number Diff line change @@ -479,7 +479,7 @@ pub struct HtmlConfig {
479
479
/// The default theme to use, defaults to 'light'
480
480
pub default_theme : Option < String > ,
481
481
/// The theme to use if the browser requests the dark version of the site.
482
- /// Defaults to the same as 'default_theme'
482
+ /// Defaults to 'navy'.
483
483
pub preferred_dark_theme : Option < String > ,
484
484
/// Use "smart quotes" instead of the usual `"` character.
485
485
pub curly_quotes : bool ,
Original file line number Diff line number Diff line change @@ -511,7 +511,7 @@ fn make_data(
511
511
512
512
let preferred_dark_theme = match html_config. preferred_dark_theme {
513
513
Some ( ref theme) => theme. to_lowercase ( ) ,
514
- None => default_theme ,
514
+ None => "navy" . to_string ( ) ,
515
515
} ;
516
516
data. insert (
517
517
"preferred_dark_theme" . to_owned ( ) ,
You can’t perform that action at this time.
0 commit comments