gt
gt copied to clipboard
bslib theming integration
This PR makes it so that, when printed as an HTML table, {gt}
will derive CSS defaults from any currently active {bslib}
theme (via bs_current_theme()
), for example:
library(shiny)
library(bslib)
library(gt)
ui <- fluidPage(
theme = bs_theme(bootswatch = "darkly"),
gt_output("table")
)
server <- function(input, output, session) {
output$table <- render_gt({
gt(mtcars)
})
}
shinyApp(ui, server)
It also works with real-time theming (i.e., add bslib::bs_themer()
to the server function above) and rmarkdown+bslib.