-
-
Notifications
You must be signed in to change notification settings - Fork 232
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
Use iframe for widget #105
Comments
Released on 1.2.1 |
@djyde Regarding the breaking change: User can supply his own css with an attribute on <iframe src="iframe.html" data-css="overrides.css" frameborder="0"></iframe> then iframe can read this url and inject it to its own <script>
const overridesCssUrl = window.frameElement.dataset.css;
if (
overridesCssUrl !== undefined &&
!document.head.querySelector("#overrides")
) {
const style = document.createElement("link");
style.rel = "stylesheet";
style.href = overridesCssUrl;
style.id = "overrides";
document.head.append(style);
}
</script> here's a working example |
How could one go about overriding Cusdis's CSS if they're using the hosted version? |
Working on branch
iframe
Benefit of using iframe
Breaking change
Roadmap
The text was updated successfully, but these errors were encountered: