gpt4 book ai didi

css - 在 Shiny 中更改选择器输入项的颜色

转载 作者:行者123 更新时间:2023-12-04 16:26:11 27 4
gpt4 key购买 nike

this example有人可以告诉我是否可能以及如何更改pickerInput 下拉菜单中元素的字体颜色。来自 shinyWidgets 的 UI包裹?
这是小部件的一个简短示例:

library("shiny")
library("shinyWidgets")

shinyApp(
ui =
shinyUI(fluidPage(
sidebarLayout(
sidebarPanel(
pickerInput("select", label=NULL,
choices=LETTERS,
selected = LETTERS,
multiple=TRUE,
options = list(
`actions-box` = TRUE,
size = 10,
`selected-text-format` = "count > 3"
))
),
mainPanel())
)
),
server = function(input, output){}
)
> sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats4 parallel stats graphics grDevices utils datasets methods base

other attached packages:
[1] shinyWidgets_0.5.3 dendextend_1.13.4 tidyr_1.1.0 patchwork_1.0.1 ggplot2_3.3.1
[6] shinyhelper_0.3.2 colorspace_1.4-1 colourpicker_1.0 shinythemes_1.1.2 DT_0.13
[11] dplyr_1.0.0 shiny_1.4.0.2 MSnbase_2.14.2 ProtGenerics_1.20.0 S4Vectors_0.26.1
[16] mzR_2.22.0 Rcpp_1.0.4.6 Biobase_2.48.0 BiocGenerics_0.34.0

最佳答案

尝试添加

tags$head(
tags$style(HTML("
.dropdown-menu a{
color: red !important;
}
"))
这是你要找的吗?
  ui = 
shinyUI(fluidPage(tags$head(
tags$style(HTML("
.dropdown-menu a{
color: red !important;
}
"))
),
sidebarLayout(
sidebarPanel(
pickerInput("select", label=NULL,
choices=LETTERS,
selected = LETTERS,
multiple=TRUE,
options = list(
`actions-box` = TRUE,
size = 10,
`selected-text-format` = "count > 3"
))
),
mainPanel())
)
)
server = function(input, output){}

shinyApp(ui, server)

关于css - 在 Shiny 中更改选择器输入项的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63255906/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com