I would like to customize a shiny application using tabsetPanels
so that the selected panel appears in a black background with white text, and the unselected tabs show a white background with black text.
For example, In the application below, when the "Hello" tab is selected, I would like "Hello" to be in white text on a black background. But I still want the background of the panel content (the input field) to remain white.
The closest thing I've been able to find come from this question: Tab Box CSS for shinydashboard
Applying that code yields a colored background all the way across the tabsetPanel, but I still can't find a way to modify this to change the background of only the tabs. Furthermore, nothing I change in the .nav-tabs-custom
css seems to take any effect whatsoever.
I'm continually tempted to try applying changes to the tab-pane
tag CSS, but that pushes changes into the body of the tab, not the title box.
Any ideas on what I could change to get the title boxes to change background color?
ui <- shinyUI(
fluidPage(
tags$style(".nav-tabs {
background-color: #006747;
}
.nav-tabs-custom .nav-tabs li.active:hover a, .nav-tabs-custom .nav-tabs li.active a {
background-color: transparent;
border-color: transparent;
}
.nav-tabs-custom .nav-tabs li.active {
border-top-color: #FFF;
}"),
tabsetPanel(
tabPanel(
title = "Hello",
textInput(inputId = "text", label = "Input")
),
tabPanel(
title = "World"
)
)
)
)
server <- shinyServer(function(input, output, session){
})
shinyApp(ui=ui, server=server)