openforis/sepal_ui

custom frontend?

Closed this issue · 2 comments

I would say that all the modules from sepal-contrib are using the same frontend design specified in sepal-ui, however, I have found some specific cases in which I would like to change something specific on an app that I don't want to be changed in others, and something that I can only perform with js or css tricks...

What do you think if we incorporate a CustomCSS class that receives a .css file and then incorporates it in the UI?, it will be used for specific case of uses where the developer wants to implement a custom style.

My concern is that perhaps by doing this, some apps could be too different? should we restrict? do you see a problem with this?... and furthermore, if someone find a bug in the styles, the error could be fixed on the specific app but not shared among the whole framework... thoughts?

I don't see any problem with extenting the application with custom css or js. That being said I'm not sure it's worth the custom object.

to add css from a file you can simply use this one liner anywhere in your code:

from Ipython.display import display 
from ipywidgets import Html

display(Html(f"<style>{path.read_text()}</style>")

Do you consider my last message as a decent workaround or do you still want to add a CustomCss and CustomJs ?

This can also be documented somwhere so that people know it's possible