bokeh icon indicating copy to clipboard operation
bokeh copied to clipboard

Allow to configure per component stylesheets

Open mattpap opened this issue 3 years ago • 5 comments
trafficstars

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.

mattpap avatar Oct 02 '22 08:10 mattpap

@bokeh/core can we consider this the only remaining blocker to a 3.0rc?

bryevdv avatar Oct 03 '22 16:10 bryevdv

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.

mattpap avatar Oct 10 '22 07:10 mattpap

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.

mattpap avatar Oct 19 '22 07:10 mattpap

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?

philippjfr avatar Nov 09 '22 08:11 philippjfr

No, not yet. I intent to add stylesheet related models as part of fixing this issue.

mattpap avatar Nov 09 '22 10:11 mattpap