]> git.ipfire.org Git - thirdparty/bootstrap.git/commit
Update color-modes.js (#38626)
authorJeroen Akkerman <Jeroen_akkerman1@hotmail.com>
Fri, 26 May 2023 04:18:49 +0000 (06:18 +0200)
committerGitHub <noreply@github.com>
Fri, 26 May 2023 04:18:49 +0000 (21:18 -0700)
commitf0be063c9792f6fd123d933335efd0d8cc7f6f1f
tree7ecbf3595a38132961d6a3101a4a6d303a9b43a8
parentde6b9a7933a9187101204e1e1f90a532ff61237b
Update color-modes.js (#38626)

* Update color-modes.js

Fix IF statement in the prefer-color-scheme change listener always evaluating to `true` and changing the theme to "dark" even when "light" is set as the preferred theme.

| `||` | `x !== "light"` | `x !== "dark"` | Result |
|--|:--:|:--:|:--:|
| `x = "light"` | ○ | ● | ● |
| `x = "dark"` | ● | ○ | ● |
| `x = "auto"` | ● | ● | ● |
| `x = "bogus"` | ● | ● | ● |
<hr>

| `&&` | `x !== "light"` | `x !== "dark"` | Result |
|--|:--:|:--:|:--:|
| `x = "light"` | ○ | ● | ○ |
| `x = "dark"` | ● | ○ | ○ |
| `x = "auto"` | ● | ● | ● |
| `x = "bogus"` | ● | ● | ● |

* Implement re-read of stored theme
site/static/docs/5.3/assets/js/color-modes.js