Skip to content
This repository was archived by the owner on Nov 13, 2022. It is now read-only.

Commit da9790b

Browse files
committed
Fix the youtube embed for smaller screens #358
Just a quick fix for the issue #358.
1 parent ac945d2 commit da9790b

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

_includes/youtube.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
{% assign url = include.content | remove: "</a>" | split: ">" | last %}
55
{% assign base_url = url | split: "/" | last %}
66
{% endif %}
7-
<center>
8-
<iframe width="560" height="315" src="https://www.youtube.com/embed/{{base_url}}" frameborder="0" allowfullscreen></iframe>
7+
<center class="youtube-iframe-wrapper">
8+
<iframe width="730" height="315" src="https://www.youtube.com/embed/{{base_url}}" frameborder="0" allowfullscreen></iframe>
99
</center>

_sass/minima/fastpages-styles.scss

+18
Original file line numberDiff line numberDiff line change
@@ -256,3 +256,21 @@ table {
256256
pre code {
257257
font-size: 15px !important;
258258
}
259+
260+
// Handle youtube videos, so they dont break on mobile devices
261+
.youtube-iframe-wrapper {
262+
position: relative;
263+
padding-bottom: 56.10%;
264+
height: 0;
265+
overflow: hidden;
266+
}
267+
268+
.youtube-iframe-wrapper iframe,
269+
.youtube-iframe-wrapper object,
270+
.youtube-iframe-wrapper embed {
271+
position: absolute;
272+
top: 0;
273+
left: 0;
274+
width: 100%;
275+
height: 100%;
276+
}

0 commit comments

Comments
 (0)