在闪亮的应用程序中更改标签内的字体

时间:2019-10-17 21:01:05

标签: r shiny

如何在闪亮的应用程序的文本中设置字体?我应该为每个tags$更改它,还是有通用的方法?

## app.R ##
library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(

  ),
  dashboardBody(

  )
)

server <- function(input, output) { 
  tags$h3(style="color:black","font-family:Calibri", "Text")
  }

shinyApp(ui, server)

这是我要编辑的部分的示例:

output$tabers<-renderUI({
    if(input$sec=="Introduction"){
      tabsetPanel(id="I",type="tabs",tabPanel("Start", id = "StartHR",
                           tags$br(),
                           img(src='Alpha-Architect.png', align = "center",height="100%", width="50%"),


                           tags$br(),
                           tags$br(),

                           tags$h3(style="color:black", "About this Dashboard"),
                           br(),

                           p(style="text-align:justify; color:black;'",'Produced by',a("Alpha Architect.", 
                                                                                      href = "https://alphaarchitect.com"),"and",a("RStudio.", 
                                                                                                                                   href = "http://www.reproduciblefinance.com/")),
                           #br(),
                           br(),
                           p(style="text-align:justify; color:black;'",'Please read our full disclosures',a("here", 
                                                                                                            href = "https://alphaarchitect.com/disclosures")),

1 个答案:

答案 0 :(得分:1)

为什么要在服务器中编写它?

要全局应用样式,您需要在HTML的头部添加样式。

将其添加为仪表板正文:

dashboardBody(
    tags$head(
        tags$style("h3 {font-family:Calibri}")
    )
)