Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bslib theming integration #692

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

bslib theming integration #692

wants to merge 2 commits into from

Conversation

cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented Nov 20, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant