css = '''
.widget-box {
background: #f02253;
}
'''
pn.extension(raw_css=[css])Embedded css - is there any equivalent for the below implementation of css into Bokeh?

There is not currently any API to inject CSS styles in to Bokeh output (only to set CSS classes). Two possibilities:
-
Some folks have embedded
<style>tags in BokehDivobjects, which seems can work at least in some situations -
Add stylesheets to a custom Jinja template, and use the various
bokeh.embedAPIs to place plots, etc in the template.
Seems I have to use Jinja template then.
BTW
Does it exist any method/function to update the whole website when any change (i.e. in css) during app execution is made? similar to curdoc().add_periodic_callback

Bokeh does not monitor CSS for changes. Presumably you could make something work yourself with a MutationObserver (but I haven’t every tried so all I can do is suggest the possibility).

End of archived discussion · Replies are disabled