简体   繁体   English

如何从shinywidgets包中更改airDatepicker中输入的字体大小?

[英]How to change font size of the input in airDatepicker from shinywidgets package?

I'm using airDatepicker from the shinyWidgets package.我使用airDatepickershinyWidgets包。 Here's my code:这是我的代码:

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")

I also use tags$style to put all of my CSS code.我还使用tags$style来放置我所有的 CSS 代码。 Currently the font of airDatepicker (the input, not the label) is way too large for the rest of my dashboard.目前airDatepicker的字体(输入,而不是标签)对于仪表板的其余部分来说太大了。 Here's the parts which fonts I want to make smaller :这是我想要缩小字体的部分:

Here这里

How do I do it?我该怎么做? Thank you.谢谢你。

You'll have to find the correct selectors (eg with your browser):您必须找到正确的选择器(例如使用浏览器):

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)

前 后

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何更改shinyWidgets package的pickerInput的字体大小 - how to change font size for pickerInput of shinyWidgets package 如何将粗体字体大小更改为闪亮小部件 package 的 pickerInput() 中的组标题? - How to change bold font size to the headings of groups in pickerInput() of shinyWidgets package? 如何从shinyWidget更改airDatepicker中日历图标的大小? - How do I change the size of calendar icon in airDatepicker from shinyWidget? 使用格式表 package 从 R 更改表格内容的字体大小 - Change table contents' font size with formattable package from R 从flexdashboard中的shinyWidgets更改单个元素的CSS - change CSS of single element from shinyWidgets in flexdashboard 从 shinyWidgets 访问 selectizeGroupUI 中的单个输入的问题 - Problem with acccesing single input in selectizeGroupUI from shinyWidgets 限制从 shinyWidgets package 的 multiInput() 中选择的项目数 - Limit number selected items in multiInput() from shinyWidgets package 如何更改字体和棒棒糖大小? - How to change font and lollipop size? 如何更改R包Likert中所有不同文本的文本字体,大小和颜色? - How do I change the text font, size and colour of all the different texts in the R package, Likert? R过热包热图:更改下轴标签的字体大小 - R superheat package heatmaps: change bottom axis labels font size
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM