Prevent Twitter embeds from cutting off. Issue #2166

This commit is contained in:
Maurice Parker 2020-07-07 11:47:52 -05:00
parent 9b6f04b8ac
commit e1c8479515
2 changed files with 8 additions and 1 deletions

View File

@ -1,6 +1,8 @@
// 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

@ -192,12 +192,17 @@ code, pre {
padding: 0;
}
img, figure, iframe, div {
img, figure, div {
max-width: 100%;
height: auto !important;
margin: 0 auto;
}
iframe {
max-width: 100%;
margin: 0 auto;
}
figure {
margin-bottom: 1em;
margin-top: 1em;