title: Shiny Slider Styling Ignored after refresh
body: <p>I am working on a shiny app, that reads data from a file, and display the data on the app, and also allows user to refresh the data. The app works fine, except that when I 'refresh' the data with the action button, some styling are gone. </p>
  
  <p>Below is a simplified version of my <code>app.R</code></p>
  
  <pre><code>library(shiny)
  file_name &lt;- "sample.csv"
  bkg_color &lt;- "red"
  
  # Define UI for application
  ui &lt;- fluidPage(
    actionButton("refresh", "", icon("refresh") ),
    tableOutput("table"),
    uiOutput("slider")
  )
  
  # Define server logic required
  server &lt;- function(input, output, session) {
    observeEvent(input$refresh,{
      source("updatedata.R")
      showModal(modalDialog(
        title = "", 
        "Data refreshed", 
        easyClose = TRUE,
        footer = NULL
      ))
    })
    # observe the raw file, and refresh if there is change every 5 seconds
    raw &lt;- reactivePoll(5000, session, 
                            checkFunc = function(){
                              if (file.exists(file_name))
                                file.info(file_name)$mtime[1]
                              else
                                ""
                            }, 
                            valueFunc = function(){
                             read.csv(file_name)
                            })
  output$table &lt;- renderTable(raw())      
  output$slider &lt;- renderUI({
      req(raw())
      tagList(
        # styling slider bar
        tags$style(HTML(paste0(".js-irs-0 .irs-single, .js-irs-0 .irs-bar-edge, .js-irs-0 .irs-bar {background: ",
                              bkg_color,";border-top: ",bkg_color,";border-bottom: ",bkg_color,"; border: ",bkg_color,"}"))),
        sliderInput("date","", 
                    min = min(raw()$v1), 
                    max = max(raw()$v1), 
                    value = max(raw()$v1))
      )
  
    })
  
  }
  
  # Run the application 
  shinyApp(ui = ui, server = server)
  </code></pre>
  
  <p>In the above, I used <code>renderUI</code> for my slider, as the values depends on the raw values I read from the local file. And I specify the color for the slider explicitly (currently set to red).</p>
  
  <p>And in the same directory, I have <code>updatedata.R</code> that does something similar to the below:</p>
  
  <pre><code>file_name &lt;- "sample.csv"
  temp &lt;- data.frame(v1 =runif(10, min = 0, max = 100), v2 = Sys.time() )
  write.csv(x =temp, file = file_name,row.names = FALSE )
  </code></pre>
  
  <p><em>To run the sample app without error, please run the above code first to initialize the csv files.</em>  </p>
  
  <p>When the app first launches, the slider bar is red color. However, after I refresh the underlying data by clicking on the refresh button at the top of the app [<strong>NOT</strong> the browser refresh], the slider bar changed back to the default shiny app color. </p>
  
  <p>I've searched for an answer for this for quite some time, but cannot even figure out what is the root cause for this. Does anyone has experienced similar issue before, or have an idea how I can fix it, so that the color of the slider bar is unchanged after the refresh?</p>
  
  <p>Thank you!</p>