From 25337994adbacbd8d6c57783e84b2c9a5f5c5b6c Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Mon, 15 May 2023 11:05:48 -0400 Subject: [PATCH 1/5] Use `
` for default `.sidebar-title` element --- R/sidebar.R | 4 ++-- man/sidebar.Rd | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/sidebar.R b/R/sidebar.R index e18d2f045..b0d900e7f 100644 --- a/R/sidebar.R +++ b/R/sidebar.R @@ -42,7 +42,7 @@ #' @param id A character string. Required if wanting to re-actively read (or #' update) the `collapsible` state in a Shiny app. #' @param title A character title to be used as the sidebar title, which will be -#' wrapped in a `
` element with class `sidebar-title`. You can also +#' wrapped in a `
` element with class `sidebar-title`. You can also #' provide a custom [htmltools::tag()] for the title element, in which case #' you'll likely want to give this element `class = "sidebar-title"`. #' @param bg,fg A background or foreground color. If only one of either is @@ -119,7 +119,7 @@ sidebar <- function( } if (rlang::is_bare_character(title) || rlang::is_bare_numeric(title)) { - title <- div(title, class = "sidebar-title") + title <- tags$header(title, class = "sidebar-title") } collapse_tag <- diff --git a/man/sidebar.Rd b/man/sidebar.Rd index 44dc491a6..b1d59f79a 100644 --- a/man/sidebar.Rd +++ b/man/sidebar.Rd @@ -71,7 +71,7 @@ options.} update) the \code{collapsible} state in a Shiny app.} \item{title}{A character title to be used as the sidebar title, which will be -wrapped in a \verb{
} element with class \code{sidebar-title}. You can also +wrapped in a \verb{
} element with class \code{sidebar-title}. You can also provide a custom \code{\link[htmltools:builder]{htmltools::tag()}} for the title element, in which case you'll likely want to give this element \code{class = "sidebar-title"}.} From a1cdea35696f5dc0a722c53dc82ec2caf8c5631b Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Mon, 15 May 2023 11:03:05 -0400 Subject: [PATCH 2/5] Use `
@@ -51,10 +51,10 @@

Title

-
main
- +
From 2d78f9a21ff101465111d0ece2a30fa2bfe81908 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Tue, 10 Oct 2023 10:28:26 -0400 Subject: [PATCH 5/5] docs: Add NEWS item --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index 23eb91a25..f3fcb3657 100644 --- a/NEWS.md +++ b/NEWS.md @@ -38,6 +38,8 @@ * `layout_sidebar()` received a new design. The button to collapse and expand the sidebar now appears at the top edge of the sidebar, and we now use the [arrow-bar-left](https://icons.getbootstrap.com/icons/arrow-bar-left/) icon instead of [chevron-left](https://icons.getbootstrap.com/icons/chevron-left/). On mobile devices, the sidebar now fills the `layout_sidebar()` area as an overlay, rather than expanding from above the main content area. **Note** the `max_mobile_height` argument of `sidebar()` determines the maximum height of the sidebar area on mobile, but it now only applies when `open = "always"`. (#798) +* `layout_sidebar()` now uses an `