insert different color values into html code inside renderUI()

I'm creating a shinydashboard that contains some boxes. Since I want to customize the color of these boxes, I'm using renderUI and inserting html code inside. Here is my code:

 # Box for used_drugs_box----------
  output$used_drugs_box <- renderUI({
    tags$div(class = "another-box", id = "success1_id",
             box(width = 6, title = "Used Drugs", status = "success", solidHeader = TRUE,
                 plotlyOutput("used_drugs"), 
                 ""
             ),
             tags$style(HTML("
                        #success1_id .box.box-solid.box-success>.box-header {
                        color:#fff;
                        background:#7e6948
                        }

                        .box.box-solid.box-success {
                        border-bottom-color:#7e6948;
                        border-left-color:#7e6948;
                        border-right-color:#7e6948;
                        border-top-color:#7e6948;
                        }

                        ")) 
    )
    
  })
  

Inside my server function, I have a druguse_color() reactive that I hope to insert inside my html code. Specifically, I'd like to change the background, border-bottom-color, border-left-color, border-right-color, border-top-color to the value inside druguse_color() reactive.

What would be a smart way to do this?

Thank you

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.