Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion R/bslib.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ resolve_theme <- function(theme) {
# Default to cosmo theme (just like the non-bslib usage does)
# (Users can explictly opt-out with bootswatch: default)
if (!is_bs_theme(theme)) {
theme <- utils::modifyList(list(bootswatch = "cosmo"), theme)
theme_default <- list()
# bslib 0.5.1 added the "preset" option, which flexdashboard users may provide
# However, `preset` should not be set with `bootswatch`
if (packageVersion("bslib") < "0.5.1" && !"preset" %in% names(theme)) {
theme_default$bootswatch <- "cosmo"
}
theme <- utils::modifyList(theme_default, theme)
theme <- do.call(bs_theme, theme)
}
# Also default to enable-rounded: true
Expand Down