diff --git a/NEWS.md b/NEWS.md index ac17a0502..8a1ca4b62 100644 --- a/NEWS.md +++ b/NEWS.md @@ -34,6 +34,8 @@ * `uiOutput()` no longer yields unwanted double padding when it's parent container uses `gap` for spacing multiple elements (e.g., `layout_columns()`, `page_fillable()`, etc). (#992) +* `page_navbar()` and `navset_bar()` now validate and transform `padding` and `gap` arguments into appropriate CSS values. (#991) + # bslib 0.6.1 ## Bug fixes diff --git a/R/navs-legacy.R b/R/navs-legacy.R index 60630e025..3528fa282 100644 --- a/R/navs-legacy.R +++ b/R/navs-legacy.R @@ -112,6 +112,9 @@ navset_bar <- function(..., title = NULL, id = NULL, selected = NULL, header = NULL, footer = NULL, bg = NULL, inverse = "auto", collapsible = TRUE, fluid = TRUE) { + padding <- validateCssPadding(padding) + gap <- validateCssUnit(gap) + navs_bar_( ..., title = title, id = id, selected = selected, sidebar = sidebar, fillable = fillable, diff --git a/R/page.R b/R/page.R index eed165d01..2af278ab5 100644 --- a/R/page.R +++ b/R/page.R @@ -190,6 +190,7 @@ page_fillable <- function( } validateCssPadding <- function(padding = NULL) { + if (is.null(padding)) return(NULL) paste( vapply(padding, validateCssUnit, character(1)), collapse = " " @@ -386,6 +387,9 @@ page_navbar <- function( sidebar <- maybe_page_sidebar(sidebar) + padding <- validateCssPadding(padding) + gap <- validateCssUnit(gap) + # Default to fillable = F when this is called from shiny::navbarPage() # TODO: update shiny::navbarPage() to set fillable = FALSE and get rid of this hack if (missing(fillable)) { diff --git a/inst/fonts/HI_jiYsKILxRpg3hIP6sJ7fM7PqlOPHYvDP_W9O7GQTTbI1rSg.woff b/inst/fonts/HI_jiYsKILxRpg3hIP6sJ7fM7PqlOPHYvDP_W9O7GQTTbI1rSg.woff index 9244e884c..2a9ddb683 100644 Binary files a/inst/fonts/HI_jiYsKILxRpg3hIP6sJ7fM7PqlOPHYvDP_W9O7GQTTbI1rSg.woff and b/inst/fonts/HI_jiYsKILxRpg3hIP6sJ7fM7PqlOPHYvDP_W9O7GQTTbI1rSg.woff differ diff --git a/inst/fonts/KFOlCnqEu92Fr1MmWUlfBBc-.woff b/inst/fonts/KFOlCnqEu92Fr1MmWUlfBBc-.woff index db0012d1b..217f52df5 100644 Binary files a/inst/fonts/KFOlCnqEu92Fr1MmWUlfBBc-.woff and b/inst/fonts/KFOlCnqEu92Fr1MmWUlfBBc-.woff differ diff --git a/inst/fonts/QGYpz_kZZAGCONcK2A4bGOj8mNhL.woff b/inst/fonts/QGYpz_kZZAGCONcK2A4bGOj8mNhL.woff index fecd3afd9..862351b99 100644 Binary files a/inst/fonts/QGYpz_kZZAGCONcK2A4bGOj8mNhL.woff and b/inst/fonts/QGYpz_kZZAGCONcK2A4bGOj8mNhL.woff differ