rstudio / bslib

Tools for theming Shiny and R Markdown via Bootstrap 3, 4, or 5.
https://rstudio.github.io/bslib/
Other
443 stars 49 forks source link

fix: Don't add `bslib-gap-spacing` when card body is not fillable #1073

Closed gadenbuie closed 3 weeks ago

gadenbuie commented 3 weeks ago

When card_body(fillable = FALSE, ...) we should not be adding the bslib-gap-spacing class to the card body container.

App Example ```r library(shiny) # library(bslib) pkgload::load_all() library(leaflet) ui <- page_fillable( card( class = "text-bg-light", # max_height = "400px", card_body( fillable = FALSE, h3("Lehigh University"), lorem::ipsum(3, 1:3 + 1), actionButton("visit", "Visit School") ), card_body( leafletOutput("map_lehigh"), ) ) ) server <- function(input, output, session) { output$map_lehigh <- renderLeaflet({ lat <- 40.60682 long <- -75.38024 name <- "Lehigh University" leaflet() |> addTiles() |> setView(lng = long, lat = lat, zoom = 13) |> addMarkers(lng = long, lat = lat, popup = name) }) } shinyApp(ui, server) ```
Before After
image image
cpsievert commented 3 weeks ago

Looks like there at least a couple other places we unconditionally add this class -- should we be doing the same there?

gadenbuie commented 3 weeks ago

Looks like there at least a couple other places we unconditionally add this class -- should we be doing the same there?

Yeah probably! If you have the time to add those to this PR, that'd be appreciated.