rust-lang / mdBook

Create book from markdown files. Like Gitbook but implemented in Rust
https://rust-lang.github.io/mdBook/
Mozilla Public License 2.0
17.84k stars 1.62k forks source link

Fix automatic dark mode #2441

Open atjn opened 1 week ago

atjn commented 1 week ago

Automatic dark mode (in CSS) was implemented in #1069, then broken in #1641 because it moved the no-js class to a different element. This PR restores the functionality. It also implements #2134 properly.

I also noticed that the original implementation depends on the light class to be set, which it is not if a different default theme has been chosen. I have also fixed this.

Closes #2440