In page_navbar(), gap and padding are handed down to many lower-level functions until they're actually used. I think there was an assumption that one of those function would handle the validation.
For the best user experience (finding out early with a reasonable traceback), I've added early validation of these values in page_navbar() and navset_bar(). I also modified validateCssPadding() to return NULL in the base case, which makes it easier to perform the checks and matches validateCssUnit().
As pointed out in https://github.com/rstudio/bslib/issues/761?notification_referrer_id=NT_kwDOAFK18bI3NDgwODcxMTExOjU0MjA1Mjk#issuecomment-1960464297,
page_navbar(padding = 24)
isn't handled in the same way aslayout_sidebar(padding = 24)
. In the second case, we passpadding
throughvalidateCssPadding()
, which resovles24
to"24px"
.In
page_navbar()
,gap
andpadding
are handed down to many lower-level functions until they're actually used. I think there was an assumption that one of those function would handle the validation.For the best user experience (finding out early with a reasonable traceback), I've added early validation of these values in
page_navbar()
andnavset_bar()
. I also modifiedvalidateCssPadding()
to returnNULL
in the base case, which makes it easier to perform the checks and matchesvalidateCssUnit()
.