Skip to content

Commit

Permalink
add buttonColor arg
Browse files Browse the repository at this point in the history
  • Loading branch information
hypebright committed May 17, 2024
1 parent 5486ee2 commit a2a95ba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

This comment has been minimized.

Copy link
@DivadNojnarg

DivadNojnarg May 17, 2024

Member

Thanks!

- Fix various issues in documentation.
- Include new vignettes.

Expand Down
6 changes: 4 additions & 2 deletions R/f7Card.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,16 @@ 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.
#'
#' @example inst/examples/card/app.R
#' @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
Expand All @@ -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")
)
Expand Down
5 changes: 4 additions & 1 deletion man/card.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a2a95ba

Please sign in to comment.