带有主题的闪亮应用无法更改按钮背景颜色

Shiny app with theme can't change button background color

我正在尝试更改 Shiny 应用程序中按钮的背景颜色,但由于某些原因我无法更改颜色。当我查看 html 时,我什至找不到按钮的 ID,我只看到按钮内文本的 ID。

我认为这是由于 shinythemes,但我不确定。如何更改此示例应用程序中的按钮颜色?如果他们 运行 这个应用程序,或者这可能只是我的设置,任何人都可以验证他们是否有同样的问题。

library(shiny)
library(shinythemes)

ui = fluidPage(
    theme = shinytheme("cerulean"), 
    navbarPage("App Name", selected = "Tab1", 
        id = "navbar",
        position = "fixed-top", 
        tabPanel("Tab1", id = "tab1Id",
            #padding between navbar and page when using fixed-top
            tags$style(type="text/css", "body {padding-top: 70px;}"), 
            fluidPage(
                actionButton("saveBtn2", "Update Schedule", 
                    icon("floppy-o"), 
                    #style="color: #0000ff;border-color: #2e6da4; background-color: #0000ff"
                    style = "background-color: #e7e7e7; color: black"
                )
            )
        )
    )
)
server = function(input, output, session) {}
runApp(shinyApp(ui, server))

也许你想试试actionBttn

ui = fluidPage(
  theme = shinytheme("cerulean"), 
  navbarPage("App Name", selected = "Tab1", 
             id = "navbar",
             position = "fixed-top", 
             tabPanel("Tab1", id = "tab1Id",
                      #padding between navbar and page when using fixed-top
                      tags$style(type="text/css", "body {padding-top: 70px;}"), 
                      fluidPage(
                        actionBttn('insertBtn1', 
                                   'Add variable',
                                   style = "simple",
                                   color = "primary",
                                   icon=icon("floppy-o"),
                                   size = "sm",
                                   block = FALSE,
                                   no_outline = TRUE  
                        ),
                        actionButton("saveBtn2", "Update Schedule", 
                                     icon("floppy-o"), 
                                     #style="color: #0000ff;border-color: #2e6da4; background-color: #0000ff"
                                     style = "background-color: #e7e7e7; color: black"
                        )
                      )
             )
  )
)
server = function(input, output, session) {}
runApp(shinyApp(ui, server))