-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend theme-dark idea to bootswatch-dark and other customizations? #2799
Comments
Could this also be accomplished via custom CSS / JS? |
Probably, but the idea of picking different Bootswatch themes / Bootstrap variables for light and dark might not be too niche? (Or maybe it is, as probably most pkgdown websites use the default 😅) |
Yes, bslib's (and therefore pkgdown's) light/dark mode is a bit different from Quarto's, which is mostly a historical accident. Quarto developed their approach to light/dark color modes just before Bootstrap provided a built-in approach. The core approaches are roughly:
My personal opinion is that, as much as possible, Quarto should align with Bootstrap's approach. Quarto's need to compile two themes and to manage correctly applying them is fraught with gotchas and is hard to maintain. Bootstrap's approach compiles only one CSS file and leans into web standards with wide browser support. I can't speak for the Quarto team as they need to consider their current user base and backwards compatibility, but I'd caution against replicating their approach. I found this thread in part because I'm looking at making sure that brand.yml is supported in pkgdown via bslib. The brand.yml project may alleviate some of these issues. In brand.yml we currently follow Bootstrap's lead and expect a single color palette (i.e. To summarize, for Bootstrap 5, in my experience most people will get the best results by starting with a "light" Bootstrap theme and using Bootstrap's color mode feature for the dark mode variant. From there, if needed, you can usually use a little bit of CSS or Sass to tweak the dark mode styles. |
When using the light switch it is possible to specify a different syntax highlighting theme for dark mode. Could that same idea be extended to Bootswatch theme and other variables? I know pkgdown's dark mode is different from the Quarto one #2679 (comment) but the Quarto interface is actually quite handy. 😸
The text was updated successfully, but these errors were encountered: