diff options
author | Sam Potts <sam@potts.es> | 2017-12-20 15:14:05 +0000 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2017-12-20 15:14:05 +0000 |
commit | 6864149989c6a5b1bb6e9199e1f8af062c64dcc4 (patch) | |
tree | 283649e596f5a81780fabe3603bb0be7d0d47485 /src/sass/components/captions.scss | |
parent | aab53fa91fded2babdef8c3529a0ff1203f92f97 (diff) | |
download | plyr-6864149989c6a5b1bb6e9199e1f8af062c64dcc4.tar.lz plyr-6864149989c6a5b1bb6e9199e1f8af062c64dcc4.tar.xz plyr-6864149989c6a5b1bb6e9199e1f8af062c64dcc4.zip |
Converted to SASS/SCSS
Diffstat (limited to 'src/sass/components/captions.scss')
-rw-r--r-- | src/sass/components/captions.scss | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/sass/components/captions.scss b/src/sass/components/captions.scss new file mode 100644 index 00000000..9dfc2be8 --- /dev/null +++ b/src/sass/components/captions.scss @@ -0,0 +1,58 @@ +// -------------------------------------------------------------- +// Captions +// -------------------------------------------------------------- + +// Hide default captions +.plyr--full-ui ::-webkit-media-text-track-container { + display: none; +} + +.plyr__captions { + animation: plyr-fade-in 0.3s ease; + bottom: 0; + color: $plyr-captions-color; + display: none; + font-size: $plyr-font-size-captions-small; + left: 0; + padding: $plyr-control-spacing; + position: absolute; + text-align: center; + transform: translateY(-($plyr-control-spacing * 4)); + transition: transform 0.4s ease-in-out; + width: 100%; + + span { + background: $plyr-captions-bg; + border-radius: 2px; + box-decoration-break: clone; + line-height: 185%; + padding: 0.2em 0.5em; + white-space: pre-wrap; + + // Firefox adds a <div> when using getCueAsHTML() + div { + display: inline; + } + } + + span:empty { + display: none; + } + + @media (min-width: $plyr-bp-sm) { + font-size: $plyr-font-size-captions-base; + padding: ($plyr-control-spacing * 2); + } + + @media (min-width: $plyr-bp-md) { + font-size: $plyr-font-size-captions-medium; + } +} + +.plyr--captions-active .plyr__captions { + display: block; +} + +.plyr--hide-controls .plyr__captions { + transform: translateY(-($plyr-control-spacing * 1.5)); +} |