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

feat(gap-spacing): Apply gap spacing margin-bottom rules to conditionalPanel too #1031

Closed gadenbuie closed 3 months ago

gadenbuie commented 3 months ago

Fixes #1030

Applies the same margin-bottom: 0 rules that are applied in .bslib-gap-spacing and .bslib-gap-spacing > .shiny-html-output contexts to .bslib-gap-spacing > .shiny-panel-conditional.

Todo

Before

image

After

image

Example Code

library(shiny)
# library(bslib)
pkgload::load_all()

ui <- page_fillable(
  layout_columns(
    card(
      checkboxInput("checkbox", "Checkbox", TRUE),
      input_switch("switch", "All good?", TRUE),
      selectInput("select", "Select an option", LETTERS[1:3]),
      p("Some text here.")
    ),
    card(
      checkboxInput("checkbox2", "Checkbox", TRUE),
      conditionalPanel("input.checkbox2",
        input_switch("switch2", "All good?", TRUE),
        selectInput("select2", "Select an option", LETTERS[1:3])
      ),
      p("Some text here.")
    )
  )
)

server <- function(input, output, session) {

}

shinyApp(ui, server)