如何从 shinyWidgets 包更改 multiInput() 的字体颜色
How to change font color of multiInput() from shinyWidgets package
我有以下应用程序使用 shinyWidgets
包
library(shinyWidgets); library("shiny")
ui <- fluidPage(
multiInput(
inputId = "id", label = "Fruits :",
choices = c("Banana", "Blueberry", "Cherry",
"Coconut", "Grapefruit", "Kiwi",
"Lemon", "Lime", "Mango", "Orange",
"Papaya"),
selected = "Banana", width = "400px",
options = list(
enable_search = FALSE,
non_selected_header = "Choose between:",
selected_header = "You have selected:"
)
),
verbatimTextOutput(outputId = "res")
)
server <- function(input, output, session) {
output$res <- renderPrint({
input$id
})
}
shinyApp(ui = ui, server = server)
是否可以进一步自定义。特别是我想将所有选择的字体颜色更改为 Black。我在下面添加了行,但是它无法更改字体颜色
tags$head(tags$style(HTML('#id {color:#000 !important;}'))),
任何指点将不胜感激。
使用这个CSS:
css <- "#id+div div a {color: black;}"
ui <- fluidPage(
tags$head(tags$style(css)),
......
我有以下应用程序使用 shinyWidgets
包
library(shinyWidgets); library("shiny")
ui <- fluidPage(
multiInput(
inputId = "id", label = "Fruits :",
choices = c("Banana", "Blueberry", "Cherry",
"Coconut", "Grapefruit", "Kiwi",
"Lemon", "Lime", "Mango", "Orange",
"Papaya"),
selected = "Banana", width = "400px",
options = list(
enable_search = FALSE,
non_selected_header = "Choose between:",
selected_header = "You have selected:"
)
),
verbatimTextOutput(outputId = "res")
)
server <- function(input, output, session) {
output$res <- renderPrint({
input$id
})
}
shinyApp(ui = ui, server = server)
是否可以进一步自定义。特别是我想将所有选择的字体颜色更改为 Black。我在下面添加了行,但是它无法更改字体颜色
tags$head(tags$style(HTML('#id {color:#000 !important;}'))),
任何指点将不胜感激。
使用这个CSS:
css <- "#id+div div a {color: black;}"
ui <- fluidPage(
tags$head(tags$style(css)),
......