From c885d59270bec1f4bbefb085bbbcfb29449532ce Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Fri, 12 Apr 2019 12:43:45 +1000 Subject: [PATCH] Moved all video styles together --- src/sass/components/embed.scss | 37 ---------------------------------- src/sass/components/video.scss | 33 ++++++++++++++++++++++++++++++ src/sass/plyr.scss | 1 - 3 files changed, 33 insertions(+), 38 deletions(-) delete mode 100644 src/sass/components/embed.scss diff --git a/src/sass/components/embed.scss b/src/sass/components/embed.scss deleted file mode 100644 index efbb4e03..00000000 --- a/src/sass/components/embed.scss +++ /dev/null @@ -1,37 +0,0 @@ -// -------------------------------------------------------------- -// Embedded players -// YouTube, Vimeo, etc -// -------------------------------------------------------------- - -// Default to 16:9 ratio but this is set by JavaScript based on config -$embed-padding: ((100 / 16) * 9); - -.plyr__video-embed, -.plyr__video-wrapper--fixed-ratio { - height: 0; - padding-bottom: to-percentage($embed-padding); -} - -.plyr__video-embed iframe, -.plyr__video-wrapper--fixed-ratio video { - border: 0; - height: 100%; - left: 0; - position: absolute; - top: 0; - user-select: none; - width: 100%; -} - -// If the full custom UI is supported -.plyr--full-ui .plyr__video-embed { - $height: 240; - $offset: to-percentage(($height - $embed-padding) / ($height / 50)); - - // Only used for Vimeo - > .plyr__video-embed__container { - padding-bottom: to-percentage($height); - position: relative; - transform: translateY(-$offset); - } -} diff --git a/src/sass/components/video.scss b/src/sass/components/video.scss index c3dc4152..fdcf4f2d 100644 --- a/src/sass/components/video.scss +++ b/src/sass/components/video.scss @@ -20,3 +20,36 @@ // Require z-index to force border-radius z-index: 0; } + +// Default to 16:9 ratio but this is set by JavaScript based on config +$embed-padding: ((100 / 16) * 9); + +.plyr__video-embed, +.plyr__video-wrapper--fixed-ratio { + height: 0; + padding-bottom: to-percentage($embed-padding); +} + +.plyr__video-embed iframe, +.plyr__video-wrapper--fixed-ratio video { + border: 0; + height: 100%; + left: 0; + position: absolute; + top: 0; + user-select: none; + width: 100%; +} + +// If the full custom UI is supported +.plyr--full-ui .plyr__video-embed { + $height: 240; + $offset: to-percentage(($height - $embed-padding) / ($height / 50)); + + // Only used for Vimeo + > .plyr__video-embed__container { + padding-bottom: to-percentage($height); + position: relative; + transform: translateY(-$offset); + } +} diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss index 468c534c..2b6cfa20 100644 --- a/src/sass/plyr.scss +++ b/src/sass/plyr.scss @@ -29,7 +29,6 @@ @import 'components/captions'; @import 'components/control'; @import 'components/controls'; -@import 'components/embed'; @import 'components/menus'; @import 'components/sliders'; @import 'components/poster';