Set non-collapsed right navigation in bs4_book

Hi guys, I want to set non-collapsed right navigation in bs4_book, as mastering-shiny and Data Science at the Command Line, 2e . They both have non-collapsed right navigation (up to 3 levels). But when I create a default bs4_book, only 2 levels are shown explicitly, and level 3 is collapsed when not reading.

Any solution?

Thanks!

1 Like

I found the solution here

Add the following codes in your "style.css"

/* do not allow collapsed navbar in bs4_book */

@media (min-width: 576px) {
  .nav {
    display: flex !important;
    display: -webkit-flex !important
  }
  .nav:not(.nav-stacked):not(.flex-column) {
    float: none !important
  }
  .nav:not(.nav-stacked):not(.flex-column)>.bslib-nav-spacer {
    margin-left: auto !important
  }
  .nav:not(.nav-stacked):not(.flex-column)>.form-inline {
    margin-top: auto;
    margin-bottom: auto
  }
  .nav.nav-stacked {
    flex-direction: column;
    -webkit-flex-direction: column;
    height: 100%
  }
  .nav.nav-stacked>.bslib-nav-spacer {
    margin-top: auto !important
  }
}

It seems to have changed after a certain version update.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.