Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom CSS can interfere with the hosting page #3203

Open
1 task done
pngwn opened this issue Feb 15, 2023 · 1 comment
Open
1 task done

custom CSS can interfere with the hosting page #3203

pngwn opened this issue Feb 15, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@pngwn
Copy link
Member

pngwn commented Feb 15, 2023

Describe the bug

When e,mbedding a graido app, if that graiod app has custom CSS then it can interfere with both the hosting page and any other embedded demos.

This is because we got rid of the shadow DOM and standards css specificity rules apply.

We just need to scope the user provided CSS like we do with any other 'global' css. The lack of up to date css parsing libraries in python is annoying, so we can probably do something simpler. We only need to do this once when the app is created (we could also do it once per request but it is pointless work).

I haven't seen any reports for this so far and I don't think it is super common but it is probably the last major issue relating to our decision to remove the shadow dom.

Is there an existing issue for this?

  • I have searched the existing issues

Reproduction

Something like this will trigger it:

css="a { color: pink !important}"

This will make all links on the demo and hosting page and other embedded demos pink.

Screenshot

No response

Logs

-

System Info

-

Severity

annoying

@pngwn pngwn added the bug Something isn't working label Feb 15, 2023
@oobabooga
Copy link

I have been experiencing the opposite issue: gradio's CSS styles are strongly interfering with the custom CSS in my gr.HTML elements.

This happens in gradio==3.18.0 but not in gradio==3.15.0.

It is forcing me to go through the tedious task of overriding gradio's styles in the source of my gr.HTML by trial and error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants