Reputation: 3152
I'm trying to customize my selectize input
in shiny
. What I have is:
And what I would like to have is to change colour of selected items like here:
I've tried to change my css
, but I've managed to change only this "a" colour by adding:
.selectize-input.input-active, .selectize-input.input-active:hover, .selectize-control.multi .selectize-input.focus {border-color: #2196f3 !important;}
.selectize-dropdown .active {background: #2196f3 !important;}
I'd like to change also colour of "c" and "b" but I don't know how. Could you help me please?
My code:
server.R
:
library("shiny")
shinyServer(function(input, output){})
ui.R
:
library("shiny")
shinyUI(fluidPage(
sidebarLayout(
sidebarPanel(
selectizeInput("select", label=NULL,
choices=c("a", "b", "c", "d"),
multiple=TRUE, options=list(placeholder="Wybierz"))),
mainPanel())
)
)
Upvotes: 3
Views: 3566
Reputation: 1481
Is this working (just after fluidPage
and before sidebarLayout
)?
tags$head(
tags$style(HTML("
.item {
background: #2196f3 !important;
color: white !important;
}
.selectize-dropdown-content .active {
background: #2196f3 !important;
color: white !important;
}
"))
),
Upvotes: 7