繁体   English   中英

将文件输入进度条颜色更改为R Shiny中的渐变

[英]change fileinput progress bar color to gradient in R shiny

无法在我的fileinput进度栏中添加渐变色。

现在,我可以使用此处提供的代码将进度条的颜色从常规的蓝色更改为其他颜色。 fileInput中进度条的颜色-闪亮

ui <- fluidPage(

    tags$head(tags$style(".progress-bar{background-color:#3c763d;}")),

    fileInput(inputId = "fileInp", label = "Input file:",multiple = FALSE,
               accept = c(
                 "text/csv",
                 "text/comma-separated-values,text/plain",
                 ".csv"))

  )


  server <- function(input, output){


  }

  shinyApp(ui=ui, server=server)


##also tried replacing background color with code from https://www.w3schools.com/css/css3_gradients.asp but no luck :


  background-color: linear-gradient(to right, red , yellow);

但是,我想要的是像这样https://imgur.com/XdFBUIt有渐变

要在CSS中设置渐变,该属性为background-image ,不是background-color 您还必须将background-size设置为auto ,否则将其设置为40px 40px ,并且进度条将被条纹化。 这是CSS:

  tags$head(
    tags$style(
      ".progress-bar {
          background-image: linear-gradient(to right, red , yellow) !important;
          background-size: auto !important;
      }")
  )

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM