Multiselect Font color


Is it possible to set the color for the font in the mulitselect tool?
In the example below could bar and baz be shown in red f.ex and the other two in green?

from import show
from bokeh.models import CustomJS, MultiSelect

OPTIONS = [("1", "foo"), ("2", "bar"), ("3", "baz"), ("4", "quux")]

multi_select = MultiSelect(value=["1", "2"], options=OPTIONS)
multi_select.js_on_change("value", CustomJS(code="""
    console.log('multi_select: value=' + this.value, this.toString())

1 Like

There is not currently any configuration directly from Bokeh APIs or Bokeh model properties to affect the font color.If you want to try and target the CSS for the widget directly, e.g. from a custom stylesheet in a Jinja template, then the css_classes property can be used to attach additional CSS classes to the the DOM object.

This seems like a reasonable ask that just happens to be missing because no one ever asked about it before. Please feel free to file a GitHub issue to suggest making this directly configurable in future feature development work. (FWIW this would probably be a nice self-contained first issue for a new contributor in case you would be interested to become involved in Bokeh development).


Ok thanks:)

1 Like