bslib
bslib copied to clipboard
Not getting text colored using bslib but works with shiny
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:

pageFluid

I noticed that setting !important seems to solve the issue.
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")),
...
)