I have two numeric input fields, default
and different
that each have a "/mth" label on the right. I wish to change the background color of only the "/mth" associated with different
.
The first tags$style
changes the background colour of different
's numeric input.
The second tags$style
changes the background colour of all of the "/mth"s.
How do I combine the two so that the background colour of only different
's "/mth" changes?
library("shiny")
library("bslib")
library("shinyWidgets")
per_month <- "/mth"
ui <- bootstrapPage(
tags$head(
tags$style("#different {
background-color: #525250 !important;}"
),
# tags$style(".input-group-text{
# background-color: #FF6FAB !important;}"
# )
),
# https://bootswatch.com/journal/
theme = bs_theme(version = 5, "font_scale" = 1.0),
div(class = "container-fluid",
div(class = "row",
div(class="col-4",
numericInputIcon(
inputId = "default",
label = "Default",
value = 10,
min = 0,
max = 9000,
width = "160px",
icon = list(NULL, per_month)
),
),
div(class="col-4",
numericInputIcon(
inputId = "different",
label = "Different",
value = 255,
min = 0,
max = 9000,
width = "160px",
icon = list(NULL, per_month)
),
),
)
)
)
server <- function(input, output) {
}
shinyApp(ui = ui, server = server)