R shinyDashboard customize color box status

I would like to adjust the color of the window status of my brilliant application. I find css a way to change the background color of the box in this field, but not adjust the status color, but I don’t see the equivalent argument “status” in css? Thus, I print the source code of a simple page containing the considered status argument, and I looked at its class (I think class = "box box-solid box-primary"), but I can’t find it in several .css presented on this web page ... :(

Do you have an idea?

Here is this simple code:

library(shiny) library(shinydashboard) ui <- dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody( fluidRow( box(width = 6, title = "youhou", status = "primary", solidHeader = TRUE, "Box content" ) ) ) ) server <- function(input, output) {} shinyApp(ui, server) 

Thank you in advance for your help!

Cha

+5
source share
1 answer

I finally found the answer (long and hard, but always nice: D)

One of my friends (thank you, my friend !!!) shows me how to display all the CSS options of each element of a web page (and especially a shiny page: go to the corresponding page and right-click, something like "examine the element "!!

So amazing !!

Then I look deeper (very very deeper, so many classes !!), and I managed to access any css parameter from the boxes!

Here is the code for the following people:

 library(shiny) library(shinydashboard) ui <- dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody( tags$style(HTML(" .box.box-solid.box-primary>.box-header { color:#fff; background:#666666 } .box.box-solid.box-primary{ border-bottom-color:#666666; border-left-color:#666666; border-right-color:#666666; border-top-color:#666666; } ")), fluidRow( box(width = 6, title = "youhou", status = "primary", solidHeader = TRUE, "Box content" ) ) ) ) server <- function(input, output) {} shinyApp(ui, server) 

Have a good weekend!

Greetings!

+15
source

Source: https://habr.com/ru/post/1245304/


All Articles