Merge pull request #2168 from Wevah/master

Embedded widget fix
This commit is contained in:
Maurice Parker 2020-07-02 04:48:59 -05:00 committed by GitHub
commit f9805b6cbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View File

@ -1,6 +1,9 @@
// Here we are making iframes responsive. Particularly useful for inline Youtube videos.
function wrapFrames() {
document.querySelectorAll("iframe").forEach(element => {
if (element.height > 0 || parseInt(element.style.height) > 0)
return;
var wrapper = document.createElement("div");
wrapper.classList.add("iframeWrap");
element.parentNode.insertBefore(wrapper, element);

View File

@ -171,23 +171,22 @@ code, pre {
padding: 0;
}
img, figure, iframe, div {
img, figure, video, div {
max-width: 100%;
height: auto !important;
margin: 0 auto;
}
iframe {
max-width: 100%;
margin: 0 auto;
}
figure {
margin-bottom: 1em;
margin-top: 1em;
}
video {
width: 100% !important;
height: auto !important;
margin: 0 auto;
}
figcaption {
font-size: 14px;
line-height: 1.3em;