【发布时间】:2022-01-10 07:59:05
【问题描述】:
我正在尝试更改(减小)pickerinput 小部件的字体大小,但没有运气。我在线查看了其他解决方案,这些解决方案有助于改变选择选项的大小。但我需要更改选择/选定栏及其下拉菜单选项中显示的字体大小。这是一段简单的代码:
library(shiny)
shinyApp(
ui = fluidPage(
titlePanel("censusVis"),
sidebarLayout(
sidebarPanel(
helpText("Create demographic maps with
information from the 2010 US Census."),
fluidRow(column(6,
pickerInput("var",
label = "Choose a variable to display",
choices = c("Percent White", "Percent Black",
"Percent Hispanic", "Percent Asian"),
selected = "Percent White",
choicesOpt = list(
style = rep_len("font-size: 75%; line-height: 1.6;", 4)
) # choices style
)
))
),
mainPanel(textOutput("text1"))
)
),
server = function(input, output) {}
)
这一行:
choicesOpt = list(style = rep_len("font-size: 75%; line-height: 1.6;", 4)) # choices style
来自此链接:https://github.com/dreamRs/shinyWidgets/issues/74 减小了下拉菜单中的字体大小,但不是选择栏中的选定选项。 任何帮助将不胜感激。
【问题讨论】:
-
感谢@rawr 的编辑。这是我发布的第一个问题。
标签: css r shiny shinydashboard pickerinput