title: R Shiny light/dark mode switch
body: <p>I have a basic R shiny app that I would like to build a light/ dark mode switch for. I think if I can just get it working for the table tab it should be fine to do for the rest. I am aware that shinyjs is the best way to go about it but I can't seem to find the code anywhere. </p>
  
  <pre><code>library(dplyr)
  library(shiny)
  library(shinythemes)
  
  ui &lt;- fluidPage(theme = shinytheme("slate"),
                  tags$head(tags$style(HTML(
                    "
                    .dataTables_length label,
                    .dataTables_filter label,
                    .dataTables_info {
                        color: white!important;
                        }
  
                    .paginate_button {
                        background: white!important;
                    }
  
                    thead {
                        color: white;
                        }
  
                    "))),
                  mainPanel(tabsetPanel(
                    type = "tabs",
                    tabPanel(
                      title = "Table",
                      icon = icon("table"),
                      tags$br(),
                      DT::DTOutput("table")
                    )
                  )))
  
  server &lt;- function(input, output) {
    output$table &lt;- DT::renderDT({
      iris
    })
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>