bokeh
bokeh copied to clipboard
Allow to configure per component stylesheets
We already allow to configure per instances (of a component) stylesheets, but it would be inefficient to style all components of a given kind like this. This is specifically needed for panel, but will useful in general.
@bokeh/core can we consider this the only remaining blocker to a 3.0rc?
I've been stewing over this for days and I don't have a good solution for now, at least not one I could commit to. I think the best approach would be to add support for some kind of static properties to models, but this will require improvements to serialization (possibly sharing logic with serialization of data models). This isn't anything I will be able to finish today, so let's not postpone the RC anymore.
I think that at this point this shouldn't be rushed and designed properly in 3.0.x or 3.1. As shown in PR #12494, extensions can be upgraded easily without this, because the typical setup is either referring to a CDN or inlining CSS in an extension's bundle. Additionally we will recommend that developers of extensions and stylessheets to postpone anyway until 3.1. panel is not a typical case and requires more flexibility. However, the original way of including CSS may not be the best option going forward (as discussed in bokeh-internal), so let's design this with actual needs in mind.
We already allow to configure per instances (of a component) stylesheets
Right now I can only see how to provide stylesheets as strings, could we also allow serializing imported stylesheets on the stylesheets property or is that somehow already supported and I just missed it?
No, not yet. I intent to add stylesheet related models as part of fixing this issue.