如何从 shinywidgets 包更改 airDatepicker 中输入的字体大小?
How to change font size of the input in airDatepicker from shinywidgets package?
我正在使用 shinyWidgets
包中的 airDatepicker
。这是我的代码:
airDatepickerInput(inputId = "choosedate", label = "month range", range = TRUE, placeholder = "choose month range", dateFormat = "M yy", view = "months", minView = "months", clearButton = TRUE,
autoClose = TRUE, update_on = "close", inline = FALSE, monthsField = "monthsShort", separator = " - ",
width = "161px", value = c("2010-01-01", "2019-12-31"), addon = "right")
我还使用 tags$style
来放置我所有的 CSS 代码。目前 airDatepicker
的字体(输入,而不是标签)对于我仪表板的其余部分来说太大了。这是我想要缩小字体的部分:
Here
我该怎么做?谢谢。
您必须找到正确的选择器(例如使用您的浏览器):
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
tags$head(tags$style(HTML('
#choosedate {font-size: 75%}
#datepickers-container > div > nav {font-size: 75%;}
#datepickers-container > div > div.datepicker--content {font-size: 75%;}
#datepickers-container > div > div.datepicker--buttons > span {font-size: 75%;}
'))),
airDatepickerInput(inputId = "choosedate", label = "month range", range = TRUE, placeholder = "choose month range", dateFormat = "M yy", view = "months", minView = "months", clearButton = TRUE,
autoClose = TRUE, update_on = "close", inline = FALSE, monthsField = "monthsShort", separator = " - ",
width = "161px", value = c("2010-01-01", "2019-12-31"), addon = "right")
)
server <- function(input, output, session) {}
shinyApp(ui, server)
我正在使用 shinyWidgets
包中的 airDatepicker
。这是我的代码:
airDatepickerInput(inputId = "choosedate", label = "month range", range = TRUE, placeholder = "choose month range", dateFormat = "M yy", view = "months", minView = "months", clearButton = TRUE,
autoClose = TRUE, update_on = "close", inline = FALSE, monthsField = "monthsShort", separator = " - ",
width = "161px", value = c("2010-01-01", "2019-12-31"), addon = "right")
我还使用 tags$style
来放置我所有的 CSS 代码。目前 airDatepicker
的字体(输入,而不是标签)对于我仪表板的其余部分来说太大了。这是我想要缩小字体的部分:
Here
我该怎么做?谢谢。
您必须找到正确的选择器(例如使用您的浏览器):
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
tags$head(tags$style(HTML('
#choosedate {font-size: 75%}
#datepickers-container > div > nav {font-size: 75%;}
#datepickers-container > div > div.datepicker--content {font-size: 75%;}
#datepickers-container > div > div.datepicker--buttons > span {font-size: 75%;}
'))),
airDatepickerInput(inputId = "choosedate", label = "month range", range = TRUE, placeholder = "choose month range", dateFormat = "M yy", view = "months", minView = "months", clearButton = TRUE,
autoClose = TRUE, update_on = "close", inline = FALSE, monthsField = "monthsShort", separator = " - ",
width = "161px", value = c("2010-01-01", "2019-12-31"), addon = "right")
)
server <- function(input, output, session) {}
shinyApp(ui, server)