Skip to content

Commit

Permalink
Bugfix: Prevent Embedded Video Clipping in Safari (#1957)
Browse files Browse the repository at this point in the history
This PR addresses a bug where iframe video players like YouTube or
Vimeo used in an Embed object would offset to the left when playing
in Safari, resulting in the left side of the player being cut off.

Fixes #828
  • Loading branch information
spaceninja authored Jul 15, 2022
1 parent f284b33 commit 1c7f142
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-stingrays-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudfour/patterns": patch
---

Bugfix: Prevent Embed videos from clipping in Safari
6 changes: 5 additions & 1 deletion src/mixins/_ratio-box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ $aspect-ratio-map: meta.module-variables('aspect-ratio');
inline-size: 100%;
inset-block-start: 0;
inset-inline-start: 0;
position: absolute;
}

> img,
> picture > img {
object-fit: cover;
object-position: center;
position: absolute;
}
}

Expand Down

0 comments on commit 1c7f142

Please sign in to comment.