Why does changing the navbar color not work with BS version 4 and 5 in shiny (version 1.6.0.9022)?
Reproducible example:
app.R
library(shiny)
library(bslib)
theme_test <- bs_theme(version = 5,
primary = "#d83e3e") %>%
bs_add_rules(sass::sass_file("custom.scss"))
ui <- navbarPage(title = "Test", theme = theme_test)
server <- function(input, output) {}
shinyApp(ui, server)
custom.scss
.navbar {
background-color: $primary;
color: $primary;
}
run
library(shiny)
runApp("FOLDERNAME")
After fiddling around a bit, I found the correct css/sass:
.bg-light, .navbar-default {
background-color: $primary !important;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With