quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.98k stars 328 forks source link

Make Bootswatch paired light and dark themes available #6741

Open dragonstyle opened 1 year ago

dragonstyle commented 1 year ago

Discussed in https://github.com/quarto-dev/quarto-cli/discussions/6740

Originally posted by **allefeld** September 6, 2023 ### Description For many of the Bootswatch themes there seem to be paired light and dark versions. For example, on the Cosmo theme page there is a switch in the upper right corner which toggles between the standard light version and a version which retains fonts, formatting, and many colors, but has light-on-dark text. I tried to implement that for my own website using ````yaml theme: light: cosmo dark: cosmo ```` and ````yaml theme: light: cosmo dark: cosmo-dark ```` or ````yaml theme: light: cosmo dark: cosmo_dark ```` but none of these work. I downloaded the source code from the light and the dark version of the Cosmo theme page and compared the files, and the only difference seems to be that the `html` element has an additional attribute `data-bs-theme="dark"`. Manipulating that manually via the inspector works on the Bootswatch theme page, but it does not work on Quarto-generated pages. It would be nice if there was a way to take advantage of these paired themes in Quarto, instead of pairing two different light and dark themes.
cderv commented 1 year ago

Just adding reference to this new feature in Bootstrap 5.3.0:

th0ger commented 1 year ago

Just looking for this. The only traditional bootswatch themes that can be used in paired light/dark mode without changing fonts etc. is flatly/darkly:

format:
  html:
    theme:
      light: flatly
      dark: darkly

The customizing themes approach is not feasible in practice.

kadykov commented 7 months ago

Just looking for this. The only traditional bootswatch themes that can be used in paired light/dark mode without changing fonts etc. is flatly/darkly.

There is one more option:

format:
  html:
    theme:
      light: cosmo
      dark: solar
follhim commented 2 months ago

I see that we are past v1.5, has this been added?

cderv commented 2 months ago

@follhim as you can see from latest update in the thread line, it has be moved out of 1.5 to later version.

Also, usually if this has been added, the issue will be closed. This one is still open.

Thanks for your patience.