我设法在闪亮的仪表板标题中放置了一个操作按钮。但是,当使用 应用样式时tags$li
,它仅适用于侧边栏。删除该tags$a
部分时,样式将应用于整个标题。不知道如何修复它,因此整个标题的样式是一致的 - 希望在堆栈溢出中获得一些提示/方向。
我看过这些帖子:
这个问题是我上一个问题的扩展:调整操作按钮的大小会导致闪亮仪表板中的标题错位
这是一个代表(下图):
library(shiny)
library(shinydashboard)
library(htmltools)
library(shinyjs)
ui <- dashboardPage(
dashboardHeader(
tags$li(class = "dropdown",
tags$a(actionButton(inputId = "email1", label = "",
icon = icon("envelope", lib = "font-awesome")
#Also tried to adjust the width and height of transparent, no luck
# ,
# style='height: 20px;
# background: transparent;
# border: none;
# font-size: 2rem;
# transform: translate(5%, -30%);'
),
href="mailto:have_a_nice_day@yep.com;"),
# has no effect on the main header bar (the header in which button is placed)
tags$style(".main-header {max-height: 20px}"),
tags$style(".main-header .logo {height: 20px;}"),
tags$style(".sidebar-toggle {height: 20px; padding-top: 1px !important;}"),
tags$style(".navbar {min-height:20px !important}")
)
),
dashboardSidebar(
),
dashboardBody()
)
server <- function(input, output){}
shinyApp(ui, server)
非常感谢您的帮助!