Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not getting text colored using bslib but works with shiny #1125

Open
furrrpanda opened this issue Oct 22, 2024 · 2 comments
Open

Not getting text colored using bslib but works with shiny #1125

furrrpanda opened this issue Oct 22, 2024 · 2 comments

Comments

@furrrpanda
Copy link

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
Copy link
Author

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

@cpsievert
Copy link
Collaborator

cpsievert commented Oct 22, 2024

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")),
  ...
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants