mansanto mansanto - 4 months ago 129
HTML Question

changing the font color of the sidebar in shiny dashboard

I have literally no html/css experience and hence I solicit your help with the following.

I am using a shiny dashboard with a default sidebar. I tried to change the background color and the font color of the sidebar using the following line of code inside the dashboardBody:

tags$head(tags$style(HTML('.skin-black .main-sidebar {color: #000000; background-color: #FFB6C1;}')))


What happened was that the new sidebar has a background color of #FFB6C1, which I intended to. But the font color in the sidebar didn't change into black and it is still white! Any suggestion?

Thanks a lot
San

Answer

I came across an example that helped me solving the issue. http://journocode.com/2016/04/04/r-first-web-application-shiny/

Accordingly, the problem was solved by used:

label = HTML('<p style="color:black;">Maximum number of suggestions</p>')

in order to depict the color of the label in black instead of white color obtained when using only:

label = "Maximum number of suggestions"

Of course both were arguments of the selectInput object.

Thanks KH for the help and of course thanks MARIE-LOUISE TIMCKE for your amazing post.

Ciao

Comments