Open daattali opened 1 month ago
I think the ship has probably sailed at this point for accepting a string. We also do throw an informative error:
> bslib::page("bar", theme = "foo")
Error in assert_bs_theme(theme) : `theme` must be a `bs_theme()` object
Strange, I tested on both the CRAN version and the latest github version of {bslib}, and ui <- page(theme = "style.css", "test")
does work for me. No error message, and it applies the stylesheet.
Ahh, right, that error only gets thrown when rendered statically. Otherwise, it gets passed to shiny::bootstrapPage()
, which doesn't error. Maybe we should do more to throw earlier on.
In shiny's page functions, the
theme
argument can accept either abs_theme()
object or a path to a CSS file.In bslib's page functions, the documentation says that the only acceptable value is a
bs_theme()
object. However, it seems that providing a string path to a CSS file also works. Should this be accepted or no? If yes, it should be documented. If no, an error should get thrown.