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

Commit

Permalink
Merge pull request #553 from xpire/fix/youtube-mobile
Browse files Browse the repository at this point in the history
Fix the youtube embed for smaller screens #358
  • Loading branch information
Hamel Husain authored Jul 17, 2021
2 parents f2f16aa + da9790b commit bc773ea
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _includes/youtube.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
{% assign url = include.content | remove: "</a>" | split: ">" | last %}
{% assign base_url = url | split: "/" | last %}
{% endif %}
<center>
<iframe width="560" height="315" src="https://www.youtube.com/embed/{{base_url}}" frameborder="0" allowfullscreen></iframe>
<center class="youtube-iframe-wrapper">
<iframe width="730" height="315" src="https://www.youtube.com/embed/{{base_url}}" frameborder="0" allowfullscreen></iframe>
</center>
18 changes: 18 additions & 0 deletions _sass/minima/fastpages-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,21 @@ table {
pre code {
font-size: 15px !important;
}

// Handle youtube videos, so they dont break on mobile devices
.youtube-iframe-wrapper {
position: relative;
padding-bottom: 56.10%;
height: 0;
overflow: hidden;
}

.youtube-iframe-wrapper iframe,
.youtube-iframe-wrapper object,
.youtube-iframe-wrapper embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

0 comments on commit bc773ea

Please sign in to comment.