I'd like to alter a part of a SelectizeInput dropdown option. For example, if any choice ends with a "*", the "*" should be bold (or in a bigger font). I'm not sure that the individual choices can be manipulated in such a way. For example:
library(shiny)
ui <- fluidPage(
selectizeInput("select",
label = "Chooose one",
choices = c("Option 1", "Option 2 *", "Option 3"))
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
The second choice should have a bold "*" at the end. Can this be achieved?
Adding
div[data-value*="*"]to your css will fuzzily match any of the choices containing "*". The request you make for anything ending withthewould be dealt with usingdiv[data-value$="the"]. See https://www.w3.org/TR/selectors/#attribute-substrings for more options and thanks to How to change css style based on value and How can I select elements in CSS by partial ID value? for getting me there.Edit:
This is the closest I can get (via Change last letter color) but it is extremely hacky and I can't get it to work properly. If only there was
::last-letter!