Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing menu icon in shiny dashboard

The following css style corresponds to the menu icon in a shiny dashboard. I want to change it. I tried with tags$head(tags$style.. in the body, but it didn't work. Any ideas?

.main-header .sidebar-toggle:before {
    content: "\f0c9";
}
like image 689
Ferroao Avatar asked Feb 23 '17 13:02

Ferroao


1 Answers

You need to escape the \:

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

server <- function(input, output) { }

shinyApp(ui, server)

I also generally wrap the CSS in HTML to prevent escaping of other HTML characters.

like image 125
NicE Avatar answered Nov 11 '22 11:11

NicE