Cybernetic
Cybernetic

Reputation: 13334

How to add css tag to SideBarPanel in Shiny App (R)

I want to change the background color of the sideBarPanels on my page in my shiny app....but...only on one specific page. So I am thinking of using CSS tags but am unsure how to do it.

I tried this:

sidebarPanel(class="set1",   
htmlOutput("vizTest")
)

And then tried referencing the class in the CSS file:

#set1 form.well { 
background: transparent;
border: 0px;
}

Upvotes: 4

Views: 2375

Answers (1)

Cybernetic
Cybernetic

Reputation: 13334

So the trick was to wrap the sidebarPanel in a div and then set the class for the div. Then it can be referenced in the usual manner using the '.' prefix:

ui.R

div(class="set1",
sidebarPanel(

#content of panel here

))

css file

.set1 form.well { 
background: transparent;
border: 0px;
}

Upvotes: 6

Related Questions