【问题标题】:How can I change the text size in Shiny modals?如何更改 Shiny modals 中的文本大小?
【发布时间】:2018-08-01 13:19:14
【问题描述】:

我通过编辑 css 文件成功地更改了闪亮仪表板界面中的文本大小。

或者我使用以下结构:

div(DTOutput(outputId = "table"), style = "font-size:85%"))

但是,我找不到闪亮模态的节点名称。 是否可以通过 .css 更改闪亮模态中的文本大小?

【问题讨论】:

    标签: r shiny shinydashboard


    【解决方案1】:

    你在寻找这样的东西吗?

    shinyApp(
        ui = basicPage(
            actionButton("show", "Show modal dialog")
        ),
        server = function(input, output) {
            observeEvent(input$show, {
                showModal(modalDialog(
                    title = "Important message",
                    div("This is an important message!", style="font-size:160%")
                ))
            })
        }
    )
    

    ModalDialog 将 UI 元素作为其第一个参数。这似乎与其他闪亮元素所接受的论点相同。例如比较:?siderbarPanel 和 ?modalDialog。因此,如果您可以在应用程序的主体中执行此操作,那么您可能可以在模态中执行此操作。

    例如,我将侧边栏布局卡在模态框内:

    shinyApp(
        ui = basicPage(
            actionButton("show", "Show modal dialog")
        ),
        server = function(input, output) {
            observeEvent(input$show, {
                showModal(modalDialog(
                    sidebarLayout(sidebarPanel("yeah"),mainPanel("cool"))
                ))
            })
        }
    )
    

    【讨论】:

      猜你喜欢
      • 2019-07-27
      • 1970-01-01
      • 1970-01-01
      • 2018-02-02
      • 2018-01-23
      • 2021-05-12
      • 2011-10-06
      • 2018-01-18
      • 1970-01-01
      相关资源
      最近更新 更多