Changing CSS styling of single shinywidgets element using shinythemes packages

你说的曾经没有我的故事 提交于 2020-12-05 12:51:19

问题


I am using shinythemes to apply bootstrap styling to my app, and shinyWidgets for many of the UI elements. I prefer the functionality and ease of pickerInput over selectizeInput, but I don't like the styling of that one element in the theme I'm using. Is it possible to use the default shiny style sheet for just that one element (i.e., without having to specify all the desired CSS elements as in this post)? I suspect there's some style element name or class I can apply using style options, but I can't seem to find the right one...

library(shiny)
library(shinythemes)
library(shinyWidgets)

ui <- fluidPage(
  theme=shinytheme("lumen"), # <- comment out this line to see the default styling.
  selectInput("sel1", "Select Input:", choices=c("A", "B", "C")),
  selectizeInput("sel2", "Selectize Input:", choices=c("D", "E", "F"), 
    multiple=T, 
    options = list(placeholder = 'Please select an option below', 
      onInitialize = I('function() { this.setValue(""); }'))),
  pickerInput("sel3", "Picker Input:", choices=c("G", "H", "I"), 
    options=list(title="Select below"), multiple=T, 
    choicesOpt = list(subtext=c("g","h","i")))
)

server <- function(input, output, session) {}

shinyApp(ui, server)

To be clear, I would like pickerInput to look like selectizeInput in the example provided. If you comment out the theme argument, you can see what the default styling looks like, so I think the key is something about the style class that pickerInput uses from the lumen bootswatch.

Any ideas are appreciated, as always.

来源:https://stackoverflow.com/questions/53178953/changing-css-styling-of-single-shinywidgets-element-using-shinythemes-packages

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!