rstudio / bslib

Tools for theming Shiny and R Markdown via Bootstrap 3, 4, or 5.
https://rstudio.github.io/bslib/
Other
486 stars 58 forks source link

Bootswatch navbar colors with bs3compat #15

Closed cpsievert closed 4 years ago

cpsievert commented 4 years ago

For a minimal example using https://github.com/rstudio/bootstraplib/pull/13, this gives a black navbar when it should be blue -- https://bootswatch.com/3/cosmo/

library(bootstraplib)
library(shiny)

ui <- navbarPage(
  bs_sass(bootswatch = "cosmo"),
  inverse = TRUE,
  tabPanel("One",
           "One"
  ),
  tabPanel("Two",
           icon = icon("download"),
           "Two"
  ),
  navbarMenu("A submenu",
             tabPanel("Three", "Three"),
             "---",
             tabPanel("Four", "Four"),
             tabPanel("Five", "Five")
  )
)

server <- function(input, output) {}

shinyApp(ui, server)

The issue seems to be related to this bs3compat SCSS

https://github.com/rstudio/bootstraplib/blob/ceeaebe081e8ffbd788116008aac7faf4cd18c74/inst/bs3compat/_navbar_compat.scss#L38

Also, for reference, the bs3compat layer currently comes before bootswatch

https://github.com/rstudio/bootstraplib/blob/a7d5d3d2ac51c0f6044416f8319b16fabce87681/R/bs_sass.R#L80-L100

cpsievert commented 4 years ago

Oh cosmo is a weird theme where navbar-inverse in BS3 doesn't map to navbar-dark bg-dark... 😞

https://bootswatch.com/cosmo/ https://bootswatch.com/3/cosmo/

github-actions[bot] commented 1 year ago

This issue has been automatically locked. If you have found a related problem, please open a new issue (with a reproducible example or feature request) and link to this issue. :raising_hand: Need help? Connect with us on Discord or Posit Community.