Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(navbar): Validate gap and padding early #991

Merged
merged 9 commits into from
Feb 27, 2024

Conversation

gadenbuie
Copy link
Member

@gadenbuie gadenbuie commented Feb 23, 2024

As pointed out in #761, page_navbar(padding = 24) isn't handled in the same way as layout_sidebar(padding = 24). In the second case, we pass padding through validateCssPadding(), which resovles 24 to "24px".

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().

@gadenbuie gadenbuie requested a review from cpsievert February 23, 2024 16:16
@gadenbuie gadenbuie merged commit 243499a into main Feb 27, 2024
1 check passed
@gadenbuie gadenbuie deleted the fix/page-navbar-gap-padding-validate branch February 27, 2024 21:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants