Prevent Twitter embeds from cutting off. Issue #2166
This commit is contained in:
parent
9b6f04b8ac
commit
e1c8479515
@ -1,6 +1,8 @@
|
|||||||
// Here we are making iframes responsive. Particularly useful for inline Youtube videos.
|
// Here we are making iframes responsive. Particularly useful for inline Youtube videos.
|
||||||
function wrapFrames() {
|
function wrapFrames() {
|
||||||
document.querySelectorAll("iframe").forEach(element => {
|
document.querySelectorAll("iframe").forEach(element => {
|
||||||
|
if (element.height > 0 || parseInt(element.style.height) > 0)
|
||||||
|
return;
|
||||||
var wrapper = document.createElement("div");
|
var wrapper = document.createElement("div");
|
||||||
wrapper.classList.add("iframeWrap");
|
wrapper.classList.add("iframeWrap");
|
||||||
element.parentNode.insertBefore(wrapper, element);
|
element.parentNode.insertBefore(wrapper, element);
|
||||||
|
@ -192,12 +192,17 @@ code, pre {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
img, figure, iframe, div {
|
img, figure, div {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iframe {
|
||||||
|
max-width: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
figure {
|
figure {
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user