【问题标题】:How to change font size of the input in airDatepicker from shinywidgets package?如何从 shinywidgets 包更改 airDatepicker 中输入的字体大小?
【发布时间】:2020-03-27 21:32:39
【问题描述】:

我正在使用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

我该怎么做?谢谢。

【问题讨论】:

  • 标签的字体大小?
  • 不,输入的内容。我将编辑我的问题
  • 好的,请检查我的编辑。
  • 非常感谢@ismirsehregal!效果很好。
  • 如果您不介意,请查看我与airDatepicker 相关的其他问题吗?谢谢你。 stackoverflow.com/questions/59187457/…

标签: r shiny shinydashboard shinywidgets


【解决方案1】:

您必须找到正确的选择器(例如,使用您的浏览器):

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)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-03-09
    • 1970-01-01
    • 2020-03-29
    • 2016-06-01
    • 1970-01-01
    • 2022-01-10
    • 1970-01-01
    • 2021-12-19
    相关资源
    最近更新 更多