Shiny makes use of the ion-rangeslider.
I'm trying to change the formatting of the labels of a range slider. In the code below, .irs-single { color: black; background: transparent }
removes the default blue background of the label in the regular slider (top), but it has no effect on the labels of the range slider (bottom).
library(shiny)
ui <- fluidPage(
sliderInput("test1",
"Select a value:",
min = 0,
max = 50,
value = 20),
sliderInput("test2",
"Select a range:",
min = 0,
max = 50,
value = c(30, 40)),
tags$style(type = "text/css",
HTML(
".irs-single { color: black; background: transparent }")
)
)
server <- function(input, output) {
}
shinyApp(ui = ui, server = server)
I tried adding each of the following, directly targeting the range slider:
.js-irs-1 .irs-single { color: black; background: transparent }
.js-irs-1 .irs-single.to { color: black; background: transparent }
.js-irs-1 .irs-single.from { color: black; background: transparent }
But the rang slider's labels still come out with their default color, blue:
Not that it's possible to, for instance, directly target the formatting of one of the range slider's buttons:
.js-irs-1 .irs-slider.to { background: red }
library(shiny)
css <- "
.irs-from, .irs-to { color: black; background: transparent }
"
ui <- fluidPage(
sliderInput("test1",
"Select a value:",
min = 0,
max = 50,
value = 20),
sliderInput("test2",
"Select a range:",
min = 0,
max = 50,
value = c(30, 40)),
tags$style(type = "text/css", HTML(css))
)
server <- function(input, output) {
}
shinyApp(ui = ui, server = server)