☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Styling widgets with css

Community Supportserver
e5k
e5k

Hi!

I am developing an app and I am a bit lost on how to style widgets from CSS. I have followed a few questions posted here but it seems that the custom CSS I am calling still does not overwrite the class used in the generated page. At this point I need to mention my ignorance with CSS.

For instance, I create a RangeSlider with css_classes =['sliderCSS'], which I define in styles.css as:

.sliderCSS .bk-noUi-connect .bk-noUi-draggable {
    background-color: #5DADE2; 
}

This does not change the color of the bar of the slider, and when I inspect the element I see that the sliderCSS class is applied but the background color remains grey:

Is there something obvious I am missing?

Thanks a lot!

⌁   Link to post
e5k
e5k

Thanks! Is there a way to overwrite that in Bokeh? I was firstly using the .yml file but I could not find a way to access widget’s properties. Is it possible?

⌁   Link to post
p-himik
p-himik

If that’s indeed the CSS specificity that’s to blame then you can fix the issue by providing a more specific CSS selector for the background color than Bokeh does. No need to do anything else.

⌁   Link to post
e5k
e5k

I removed the specific css_class and changed

.sliderCSS .bk-noUi-connect .bk-noUi-draggable {
    background-color: #5DADE2; 
}

by

.bk-root .bk-noUi-draggable {
    background-color: #5DADE2 !important; 
}

Which seems to fix the problem. Thanks for the enlightening tip!

⌁   Link to post

End of archived discussion · Replies are disabled