Closed andrewmarx closed 1 week ago
You can use bslib to preview themes for over colors etc
https://rstudio.github.io/bslib/reference/bs_theme_preview.html
That's a cool tool, but there are some discrepancies between it, my pkgdown build results, and the bootswatch website. For example, setting the Flatly theme in my pkgdown yaml gives a result similar to the bootswatch website, but the bslib preview navbar is a completely different color (seems to be the green text color Flatly uses when hovering over links).
But then, the Spacelab theme has the opposite problem; the bslib preview navbar seems to match the color in the theme website (but is missing the gradient), and my pkgdown build is giving me a gray navbar.
Cerulean in the bslib preview has a significantly darker blue navbar than expected and is also missing the gradient.
I don't know what's going on. I'm just trying to quickly set a bootswatch theme in my pkgdown yaml so I can move on to other more important things; nothing else. I am on the most recent versions of bslib and pkgdown.
You should also be able to preview the main page after pkgdown::build_home()
, which will be fast (unless you have a complex README). So after making changes, you'd do
should only take a few seconds.
Or even just pkgdown::build_home_index()
; that's what I use if I just want to quickly preview a new look.
I'm in the process of trying to find a bootswatch theme I like, but it takes 15-20 minutes to build my site just to update the theme. For now, I've resorted to just manually downloading and swapping out the CSS file, but it could be convenient to have something like a
rebuild_theme()
command for more complicated configurations that doesn't go through the long process of rebuilding all the pages