[英]change fileinput progress bar color to gradient in R shiny
Having trouble for adding a gradient color to my fileinput progress bar. 无法在我的fileinput进度栏中添加渐变色。
Right now, I was able to change the color of the progress bar from a regular blue to something else using the code provided here. 现在,我可以使用此处提供的代码将进度条的颜色从常规的蓝色更改为其他颜色。 Colour of progress bar in fileInput -- Shiny
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);
However, what I want is to have gradient just like this https://imgur.com/XdFBUIt 但是,我想要的是像这样https://imgur.com/XdFBUIt有渐变
To set a gradient in CSS, the property is background-image
, not background-color
. 要在CSS中设置渐变,该属性为
background-image
,不是background-color
。 You also have to set the background-size
to auto
, otherwise it is set to 40px 40px
and the progress bar is striped. 您还必须将
background-size
设置为auto
,否则将其设置为40px 40px
,并且进度条将被条纹化。 Here is the CSS: 这是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.