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
reload on css changes + fix css specificity #6738
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/cfe5f674856711cd15408b80616774720313e920/gradio-4.8.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@cfe5f674856711cd15408b80616774720313e920#subdirectory=client/python" |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
|
Need to merge to check some other issues. Feel free to review and I'll address anything in another PR |
.join(","); | ||
|
||
css_string += rule.cssText; | ||
css_string += rule.cssText.replace(selector, new_selector); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I don't think repeating a css rule should have any (non-performance-related) downsides so this should be good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The number of rules should generally be pretty modest, so I think the performance should be ok.
Cool, looks great to me @pngwn! Thanks for dogfooding this workflow :) |
Description
This has been driving me up the wall all weekend, so here is a fix.
This should work fine now with no need for
!important
modifiers or other CSS hacks:We do this by modifying the selectors passed by a user, prepending them with a series of addition selectors to increase their specificity enough that they override the svelte hashed classes. It's hacky but should be relatively robust.
Closes #6735. Closes #6736.