bslib icon indicating copy to clipboard operation
bslib copied to clipboard

Not getting text colored using bslib but works with shiny

Open furrrpanda opened this issue 1 year ago • 2 comments

Describe the problem

  library(shiny)
  
  ui <- page_fluid(
    tags$style(HTML("
         @import url('https://fonts.googleapis.com/css2?family=Henny+Penny&family=Nosifer&display=swap');
         @import url('https://fonts.googleapis.com/css2?family=Nosifer&display=swap');
         .irs--shiny, .irs-min, .irs--shiny, .irs-max, .irs-single, .irs-to, .irs-from, .irs-grid-text, .js-irs-0 {
        font-family: 'Nosifer', sans-serif;
        color: red;}"
    )),
    sliderInput("a", "a", 10, 100, 50)
  )
  
  server <- function(input, output, session) {
    
  }
  
  shinyApp(ui, server)```

page_fluid:
![image](https://github.com/user-attachments/assets/72a080a9-330c-4eee-8dcc-2185ca2e80fc)

pageFluid

![image](https://github.com/user-attachments/assets/ef0cdd77-5f4e-4336-b324-f8215c1ef57b)


furrrpanda avatar Oct 22 '24 06:10 furrrpanda

I noticed that setting !important seems to solve the issue.

furrrpanda avatar Oct 22 '24 07:10 furrrpanda

Are you wanting to only set a different font family for the slider? If you want to do that more generally, I'd recommend this instead

library(bslib)

page_fluid(
  theme = bs_theme(base_font=font_google("Nosifer")),
  ...
)

cpsievert avatar Oct 22 '24 22:10 cpsievert