gt icon indicating copy to clipboard operation
gt copied to clipboard

bslib theming integration

Open cpsievert opened this issue 4 years ago • 1 comments

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.

cpsievert avatar Nov 20 '20 17:11 cpsievert