Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Require larger device size to expand navbar toggle; vertically center align toggle icon #845

Merged
merged 8 commits into from
Oct 18, 2023

Conversation

cpsievert
Copy link
Collaborator

With this PR,

  • The collapse toggle for collapsible navbars (e.g., page_navbar(collapsible = T) and navset_bar(collapsible = T)) will now apply at the lg instead of sm breakpoint.
  • The collapse toggle (as well as the title is now guaranteed to be vertically centered)

For example, shiny::runApp("inst/examples/flights"):

Before

Screenshot 2023-10-17 at 5 50 44 PM

After

Screenshot 2023-10-17 at 5 51 23 PM

@cpsievert cpsievert requested a review from gadenbuie October 17, 2023 22:58
Copy link
Member

@gadenbuie gadenbuie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this from the perspective of introducing a minimal change, but this feels like a step in the wrong direction -- going further down a path of introducing BS3 dependencies into BS5 -- rather than moving in the direction of decoupling our navbar markup from legacy uses.

This approach requires a Sass variable to customize the breakpoint, but if we weren't tied to BS3's markup, collapsible could take a string indicating the desired breakpoint and we could use the classes provided in BS5. To me, the collapse breakpoint seems like an app-dependent consideration.

That said, collapsing the navbar at md is consistent with other uses of BS5 in our ecosystem (both Quarto and pkgdown collapse at md). And if we have to pick one, this is the one I'd pick.

@cpsievert
Copy link
Collaborator Author

cpsievert commented Oct 18, 2023

For posterity, I agree 100% with what you’ve said, but the unfortunate reality is that moving things in the “right” direction (e.g., getting rid of the awkward @extend and/or moving away from .navbar-header, which doesn't exist anymore) would be a fair amount of work (not only in bslib, but rmarkdown, flexdashboard, etc), and we’re not really making the current bs3compat situation any worse off with this change

@cpsievert cpsievert merged commit 6359904 into main Oct 18, 2023
@cpsievert cpsievert deleted the navbar-collapse-improvements branch October 18, 2023 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants