rstudio / bslib

Tools for theming Shiny and R Markdown via Bootstrap 3, 4, or 5.
https://rstudio.github.io/bslib/
Other
490 stars 58 forks source link

`input_dark_mode()` should consult `html[data-bs-theme]` before `prefers-color-scheme` #1118

Closed gadenbuie closed 1 month ago

gadenbuie commented 1 month ago

We fall back to prefers-color-scheme but we should account for the document element having data-bs-theme set already, in which case we'd use that value over prefers-color-scheme.

https://github.com/rstudio/bslib/blob/7ff88a1e2a88fc7c6289059dd247ce88512f8231/srcts/src/components/webcomponents/inputDarkMode.ts#L223-L229