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(page_sidebar): Use `rlang::exec()` to ensure spliced attributes are treated as arguments #1074

Closed gadenbuie closed 3 weeks ago

gadenbuie commented 3 weeks ago

1058 introduced a subtle issue that spliced attributes weren't being treated as arguments to layout_sidebar() in page_sidebar().

This PR uses rlang::exec() to avoid that problem.

Currently, with bslib from main, the following does not work (the main content area is not white text on a purple background).

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

ui <- page_sidebar(
  bg = "purple",
  fg = "white",
  "Content here"
)

shinyApp(ui, \(...) { })