更改闪亮仪表板中的菜单图标

Changing menu icon in shiny dashboard

以下 css 样式对应于闪亮仪表板中的菜单图标。我想改变它。我尝试在正文中使用 tags$head(tags$style..,但没有用。有什么想法吗?

.main-header .sidebar-toggle:before {
    content: "\f0c9";
}

您需要转义 \:

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody(
    tags$head(tags$style(HTML('
      .main-header .sidebar-toggle:before {
        content: "\f0c7";}')))
    )
)

server <- function(input, output) { }

shinyApp(ui, server)

我通常也会将 CSS 包裹在 HTML 中以防止转义其他 HTML 字符。