12

I love the new shiny dashboard package in R. I am trying to customize the appearance and its proving difficult. I want to change the background color of the app to white.

Here is what I have done.

I have added a custom.css file to a www directory. It has this code.

body > .content-wrapper .right-side {
    background-color: #ffffff;
}

I have successfully changed the title font with the example here so I know that my css file is working.

I have also used inspect element to find the color in the css and changed it successfully from the developer console.

However the background color will not change when I set the color in my css file.

williamsurles
  • 931
  • 1
  • 7
  • 9

2 Answers2

16

Adding this to the custom.css file worked...

I found this in the css file for the adminLTE in the shiny dashboard repo.

.content-wrapper,
.right-side {
  background-color: #ffffff;
}
williamsurles
  • 931
  • 1
  • 7
  • 9
2

If you only want to change the background, in the ui.R after

shinyUI(fluidPage(

you can add this code:

tags$head(tags$style(
    HTML('
        body, label, input, button, select { 
            font-family: "Calibri";
            background-color: black;
        }')
    )),
Paul Karam
  • 4,052
  • 8
  • 30
  • 53
M455y
  • 192
  • 1
  • 3
  • 11