2

I am using bs4Dash (version >2.0) in a shiny app but I am unable to change the navbar color (change permanently irrespective of the dark/light theme) to yellow (#ffc107).

You can check the minimal example given in ?bs4Dash::skinSelector(). While the colour can be changed to yellow from 'Navbar themer' menu in the right control bar but I need to fix or default the header colour to yellow.

Here this is the minimal example given in skinselecter(). please use bs4dash version > 2.0 from github.

if (interactive()) {
 library(shiny)
 library(bs4Dash)
 
 shinyApp(
   ui = dashboardPage(
     header = dashboardHeader(),
     sidebar = dashboardSidebar(
      sidebarMenu(
       menuItem(
        text = "Item 1"
       ),
       menuItem(
        text = "Item 2"
       )
      )
     ),
     body = dashboardBody(),
     controlbar = dashboardControlbar(skinSelector(), pinned = TRUE),
     title = "Skin Selector"
   ),
   server = function(input, output) { }
 )
}
Narendra Sahu
  • 136
  • 2
  • 14

1 Answers1

1

By including below css, i was able to solve this.

.navbar-gray-dark {
    background-color: #ffc107;         
      }
.navbar-white {
background-color: #ffc107; 
}
Narendra Sahu
  • 136
  • 2
  • 14
  • Where did you put it? – RxT Oct 13 '21 at 03:08
  • at bs4Dash::dashboardHeader("title", tags$style(".navbar-gray-dark { background-color: #ffc107; } .navbar-white { background-color: #ffc107; }")) – RxT Oct 14 '21 at 02:02