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

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

Merged
merged 6 commits into from
Mar 28, 2024

Conversation

gadenbuie
Copy link
Member

@gadenbuie gadenbuie commented Mar 28, 2024

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

  • Add a news entry, but maybe we should merge NEWS grooming for v0.7.0 into main first?

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)

@gadenbuie gadenbuie marked this pull request as ready for review March 28, 2024 15:08
NEWS.md Outdated Show resolved Hide resolved
Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
Copy link
Collaborator

@cpsievert cpsievert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cpsievert cpsievert merged commit 1c11cf9 into main Mar 28, 2024
13 checks passed
@cpsievert cpsievert deleted the feat/panel-conditional-gap-spacing branch March 28, 2024 15:46
gadenbuie added a commit to posit-dev/py-shiny that referenced this pull request Mar 28, 2024
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.

.bslib-gap-spacing should account for .shiny-panel-conditional
2 participants