diff --git a/NEWS.md b/NEWS.md index 55ca377d..c1737b1a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -92,6 +92,7 @@ the new router layout. Items must be wrapped in a `shiny::tagList()`. - `f7TabLink()`: `href` can now be different of `#` if passed in `...` (Default is still `#` when no custom `href` is detected). This allows to use tab links as routable links but with a better rendering in the toolbar/tabbar than classic `f7Link()`. - `updateF7App` can now also handle changes in app theme (ios or md), dark mode, and color. - `f7Fabs()` has a new argument `global` that can be used to make FABs persistent across different tabs in `f7TabLayout()`. +- `f7ExpandableCard()` has a new argument `buttonColor` that can be used to control the color of the close button. - Fix various issues in documentation. - Include new vignettes. diff --git a/R/f7Card.R b/R/f7Card.R index 768dfcae..1d9e1a38 100644 --- a/R/f7Card.R +++ b/R/f7Card.R @@ -123,6 +123,7 @@ f7Card <- function(..., image = NULL, title = NULL, footer = NULL, outline = FAL #' @param image Card background image url. Tje JPG format is prefered. Not compatible #' with the color argument. #' @param fullBackground Whether the image should cover the entire card. +#' @param buttonColor Color of the close button. Default is "white". #' #' @note For \link{f7ExpandableCard}, image and color are not compatible. Choose one of them. #' @@ -130,7 +131,8 @@ f7Card <- function(..., image = NULL, title = NULL, footer = NULL, outline = FAL #' @export f7ExpandableCard <- function(..., id = NULL, title = NULL, subtitle = NULL, color = NULL, - image = NULL, fullBackground = FALSE) { + image = NULL, fullBackground = FALSE, + buttonColor = "white") { cardColorCl <- if (!is.null(color)) paste0("bg-color-", color) # card header if any @@ -155,7 +157,7 @@ f7ExpandableCard <- function(..., id = NULL, title = NULL, # trigger to close the card closeCard <- shiny::tags$a( href = "#", - class = paste0("link card-close card-opened-fade-in color-white"), + class = paste0("link card-close card-opened-fade-in color-", buttonColor), style = "position: absolute; right: 15px; top: 15px;", f7Icon("xmark_circle_fill") ) diff --git a/man/card.Rd b/man/card.Rd index 10dad13e..dcf548ed 100644 --- a/man/card.Rd +++ b/man/card.Rd @@ -24,7 +24,8 @@ f7ExpandableCard( subtitle = NULL, color = NULL, image = NULL, - fullBackground = FALSE + fullBackground = FALSE, + buttonColor = "white" ) updateF7Card(id, session = shiny::getDefaultReactiveDomain()) @@ -56,6 +57,8 @@ Not compatible with the img argument.} \item{fullBackground}{Whether the image should cover the entire card.} +\item{buttonColor}{Color of the close button. Default is "white".} + \item{session}{Shiny session object.} } \description{