Skip to content

Commit

Permalink
Improve theme handling when JS is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 22, 2024
1 parent 679b324 commit c93bb28
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion util/gh-pages/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ details[open] {
}

/* Expanding the mdBook theme*/
.light {
.light, body:not([class]) {
--inline-code-bg: #f6f7f6;
}
.rust {
Expand All @@ -220,6 +220,16 @@ details[open] {
--inline-code-bg: #191f26;
}

@media (prefers-color-scheme: dark) {
body:not([class]) {
/*
In case JS is disabled and the user's system is in dark mode, we take "coal" as default
dark theme.
*/
--inline-code-bg: #1d1f21;
}
}

#settings-dropdown {
position: absolute;
margin: 0.7em;
Expand Down

0 comments on commit c93bb28

Please sign in to comment.