Refactor CSS (custom styling) to rely more on Gradio #10217
micky2be
started this conversation in
Optimization
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We may all agree that Gradio is limited to build application.
But looking at the code, it seems we are having a lot of CSS hacks to customize the UI, and even some hacks on top of it to be able to revert the hack or do something else.
One of the main hack I saw is basically to remove the container design around element. May have been needed at a certain time but Gradio allows to set
my_component.style(container=False)
to remove it. Meaning it cannot be added.Also paddings have been removed, making some UI very cramped together.
Overall it makes it a bit hard to contribute (directly or via extension) by following Gradio's documentation.
So, that's why I propose to refactor the style to rely a bit more on Gradio's default, and by setting a custom theme, while adding some custom components (still a bit hard to do though).
I already made a PoC overriding Component to default to
container=False
. Still a hack but can be documented and easily reversible by devs for their components (explicitly setting it toTrue
).While I understand it might "break" some extension UI, it might be better rip the band-aid now than continuously hacking around. And should be a little bit more future proof.
I could volunteer if everyone agreed. Would definitely need help for testing.
Beta Was this translation helpful? Give feedback.
All reactions