// ==========================================================================
// Plyr styles
// https://github.com/selz/plyr
// ==========================================================================
// Variables
// -------------------------------
// Colors
@plyr-blue: #3498DB;
@plyr-gray-dark: #343F4A;
@plyr-gray: #565D64;
@plyr-gray-light: #6B7D86;
@plyr-gray-lighter: #CBD0D3;
@plyr-off-white: #D6DADD;
// Font sizes
@plyr-font-size-small: 14px;
@plyr-font-size-base: 16px;
// Captions
@plyr-font-size-captions-base: ceil(@plyr-font-size-base * 1.25);
@plyr-font-size-captions-medium: ceil(@plyr-font-size-base * 1.5);
@plyr-font-size-captions-large: (@plyr-font-size-base * 2);
// Controls
@plyr-control-spacing: 10px;
@plyr-controls-bg: #fff;
@plyr-control-bg-hover: @plyr-blue;
.contrast-control-color(@plyr-controls-bg);
.contrast-control-color-hover(@plyr-control-bg-hover);
// Tooltips
@plyr-tooltip-bg: @plyr-controls-bg;
@plyr-tooltip-border-color: fade(darken(@plyr-controls-bg, 75%), 10%);
@plyr-tooltip-arrow-border-color: fade(darken(@plyr-controls-bg, 75%), 20%);
@plyr-tooltip-border-width: 1px;
@plyr-tooltip-shadow: 0 0 5px @plyr-tooltip-border-color, 0 0 0 @plyr-tooltip-border-width @plyr-tooltip-border-color;
@plyr-tooltip-color: @plyr-control-color;
@plyr-tooltip-padding: @plyr-control-spacing;
@plyr-tooltip-arrow-size: 6px;
@plyr-tooltip-radius: 3px;
// Progress
@plyr-progress-bg: fade(@plyr-gray, 20%);
@plyr-progress-playing-bg: @plyr-blue;
@plyr-progress-buffered-bg: fade(@plyr-gray, 25%);
@plyr-progress-loading-size: 40px;
@plyr-progress-loading-bg: fade(#000, 15%);
// Volume
@plyr-volume-track-height: 6px;
@plyr-volume-track-bg: darken(@plyr-controls-bg, 10%);
@plyr-volume-thumb-height: (@plyr-volume-track-height * 2);
@plyr-volume-thumb-width: (@plyr-volume-track-height * 2);
@plyr-volume-thumb-bg: @plyr-control-color;
@plyr-volume-thumb-bg-focus: @plyr-control-bg-hover;
// Breakpoints
@plyr-bp-control-split: 560px; // When controls split into left/right
@plyr-bp-captions-large: 768px; // When captions jump to the larger font size
// Animation
// ---------------------------------------
@keyframes plyr-progress {
to { background-position: @plyr-progress-loading-size 0; }
}
// Mixins
// -------------------------------
// Contrast
.contrast-control-color(@plyr-color: "") when (lightness(@plyr-color) >= 65%) {
@plyr-control-color: @plyr-gray-light;
}
.contrast-control-color(@plyr-color: "") when (lightness(@plyr-color) < 65%) {
@plyr-control-color: @plyr-gray-lighter;
}
.contrast-control-color-hover(@plyr-color: "") when (lightness(@plyr-color) >= 65%) {
@plyr-control-color-hover: @plyr-gray;
}
.contrast-control-color-hover(@plyr-color: "") when (lightness(@plyr-color) < 65%) {
@plyr-control-color-hover: #fff;
}
// Font smoothing
.font-smoothing(@mode: on) when (@mode = on) {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
}
.font-smoothing(@mode: on) when (@mode = off) {
-moz-osx-font-smoothing: auto;
-webkit-font-smoothing: subpixel-antialiased;
}
// styling
.volume-thumb() {
height: @plyr-volume-thumb-height;
width: @plyr-volume-thumb-width;
background: @plyr-volume-thumb-bg;
border: 0;
border-radius: 100%;
transition: background .3s ease;
cursor: ew-resize;
}
.volume-track() {
height: @plyr-volume-track-height;
background: @plyr-volume-track-bg;
border: 0;
border-radius: (@plyr-volume-track-height / 2);
}
.seek-thumb() {
background: transparent;
border: 0;
width: 1px;
height: @plyr-control-spacing;
}
.seek-thumb-touch() {
width: (@plyr-control-spacing * 4);
transform: translateX(-50%);
}
.seek-track() {
background: none;
border: 0;
}
// Styles
// -------------------------------
// Base
.plyr {
position: relative;
max-width: 100%;
min-width: 290px;
font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
// border-box everything
// http://paulirish.com/2012/box-sizing-border-box-ftw/
&,
*,
*::after,
*::before {
box-sizing: border-box;
}
// Fix 300ms delay
a, button, input, label {
touch-action: manipulation;
}
// Screen reader only elements
&__sr-only {
position: absolute !important;
clip: rect(1px, 1px, 1px, 1px);
padding: 0 !important;
border: 0 !important;
height: 1px !important;
width: 1px !important;
overflow: hidden;
}
// For video
&__video-wrapper {
position: relative;
}
video,
audio {
width: 100%;
height: auto;
vertical-align: middle;
}
// Hide default captions
video::-webkit-media-text-track-container {
display: none;
}
// Container for embeds
&__video-embed {
padding-bottom: 56.25%; /* 16:9 */
height: 0;
overflow: hidden;
background: #000;
iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 0;
user-select: none;
}
// Vimeo hack
> div {
position: relative;
padding-bottom: 200%;
transform: translateY(-35.95%);
}
// To allow mouse events to be captured if full support
&.plyr iframe {
pointer-events: none;
}
}
// Captions
&__captions {
display: none;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: (@plyr-control-spacing * 2) (@plyr-control-spacing * 2) (@plyr-control-spacing * 3);
color: #fff;
font-size: @plyr-font-size-captions-base;
text-align: center;
.font-smoothing();
span {
border-radius: 2px;
padding: 3px 10px;
background: fade(#000, 90%);
}
span:empty {
display: none;
}
@media (min-width: @plyr-bp-captions-large) {
font-size: @plyr-font-size-captions-medium;
}
}
&--captions-active &__captions {
display: block;
}
&--fullscreen-active &__captions {
font-size: @plyr-font-size-captions-large;
}
// Playback controls
&__controls {
.font-smoothing();
position: relative;
padding: @plyr-control-spacing;
background: @plyr-controls-bg;
line-height: 1;
text-align: center;
box-shadow: 0 1px 1px fade(@plyr-gray-dark, 20%);
// Clear floats
&::after {
content: '';
display: table;
clear: both;
}
// Layout
&--right {
display: block;
margin: @plyr-control-spacing auto 0;
}
@media (min-width: @plyr-bp-control-split) {
&--left {
float: left;
}
&--right {
float: right;
margin-top: 0;
}
}
// Buttons
button {
display: inline-block;
vertical-align: middle;
margin: 0 2px;
padding: (@plyr-control-spacing / 2) @plyr-control-spacing;
overflow: hidden;
border: 0;
background: transparent;
border-radius: 3px;
cursor: pointer;
color: @plyr-control-color;
transition: background .3s ease, color .3s ease, opacity .3s ease;
svg {
width: 18px;
height: 18px;
display: block;
fill: currentColor;
transition: fill .3s ease;
}
// Hover and tab focus
&.tab-focus:focus,
&:hover {
background: @plyr-control-bg-hover;
color: @plyr-control-color-hover;
}
// Default focus
&:focus {
outline: 0;
}
}
// Hide toggle icons by default
.icon--exit-fullscreen,
.icon--muted,
.icon--captions-on {
display: none;
}
// plyr time
.plyr__time {
display: inline-block;
vertical-align: middle;
margin-left: @plyr-control-spacing;
color: @plyr-control-color;
font-weight: 600;
font-size: @plyr-font-size-small;
}
// Media duration hidden on small screens
.plyr__time + .plyr__time {
display: none;
@media (min-width: @plyr-bp-control-split) {
display: inline-block;
}
// Add a slash in before
&::before {
content: '\2044';
margin-right: @plyr-control-spacing;
}
}
}
// Tooltips
&__tooltip {
visibility: hidden;
position: absolute;
z-index: 2;
bottom: 100%;
margin-bottom: @plyr-tooltip-padding;
padding: @plyr-tooltip-padding (@plyr-tooltip-padding * 1.5);
opacity: 0;
background: @plyr-tooltip-bg;
box-shadow: @plyr-tooltip-shadow;
border-radius: @plyr-tooltip-radius;
color: @plyr-tooltip-color;
font-size: @plyr-font-size-small;
line-height: 1.5;
font-weight: 600;
transform: translate(-50%, 10px) scale(.8);
transform-origin: 50% 100%;
transition: transform .2s .1s ease, opacity .2s .1s ease, visibility .3s ease;
// Arrows
&::after,
&::before {
content: '';
position: absolute;
width: 0;
height: 0;
top: 100%;
left: 50%;
transform: translateX(-50%);
}
// The border triangle
&::after {
@plyr-border-arrow-size: (@plyr-tooltip-arrow-size + (@plyr-tooltip-border-width * 1));
bottom: -(@plyr-border-arrow-size + @plyr-tooltip-border-width);
border-right: @plyr-border-arrow-size solid transparent;
border-top: @plyr-border-arrow-size solid @plyr-tooltip-arrow-border-color;
border-left: @plyr-border-arrow-size solid transparent;
z-index: 1;
}
// The background triangle
&::before {
bottom: -@plyr-tooltip-arrow-size;
border-right: @plyr-tooltip-arrow-size solid transparent;
border-top: @plyr-tooltip-arrow-size solid @plyr-tooltip-bg;
border-left: @plyr-tooltip-arrow-size solid transparent;
z-index: 2;
}
}
button:hover .plyr__tooltip,
button.tab-focus:focus .plyr__tooltip,
&__tooltip--visible {
visibility: visible;
opacity: 1;
transform: translate(-50%, 0) scale(1);
}
button:hover .plyr__tooltip {
z-index: 3;
}
// Common range styles
input[type='range'] {
&::-ms-tooltip {
display: none;
}
&.tab-focus:focus {
outline: 1px dotted fade(@plyr-gray-dark, 80%);
outline-offset: 3px;
}
}
// Playback progress
//