diff --git a/dist/plyr.css b/dist/plyr.css index d3a1f20b..76434bdc 100644 --- a/dist/plyr.css +++ b/dist/plyr.css @@ -1 +1 @@ -.plyr__captions,.plyr__controls{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-align:center}@-webkit-keyframes progress{to{background-position:40px 0}}@keyframes progress{to{background-position:40px 0}}.plyr{position:relative;max-width:100%;min-width:290px}.plyr,.plyr *,.plyr ::after,.plyr ::before{box-sizing:border-box}.plyr a,.plyr button,.plyr input,.plyr label{-ms-touch-action:manipulation;touch-action:manipulation}.plyr__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}.plyr__video-wrapper{position:relative}.plyr audio,.plyr video{width:100%;height:auto;vertical-align:middle}.plyr__video-embed{padding-bottom:56.25%;height:0;overflow:hidden;background:#000}.plyr__video-embed iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.plyr__video-embed>div{position:relative;padding-bottom:200%;-webkit-transform:translateY(-35.95%);transform:translateY(-35.95%)}.plyr__captions{display:none;position:absolute;bottom:0;left:0;width:100%;padding:20px 20px 30px;color:#fff;font-size:20px}.plyr__captions span{border-radius:2px;padding:3px 10px;background:rgba(0,0,0,.9)}.plyr__captions span:empty{display:none}@media (min-width:768px){.plyr__captions{font-size:24px}}.plyr--captions-active .plyr__captions{display:block}.plyr--fullscreen-active .plyr__captions{font-size:32px}.plyr__controls{zoom:1;position:relative;padding:10px;background:#fff;line-height:1;box-shadow:0 1px 1px rgba(52,63,74,.2)}.plyr__controls:after,.plyr__controls:before{content:"";display:table}.plyr__controls:after{clear:both}.plyr__controls--right{display:block;margin:10px auto 0}@media (min-width:560px){.plyr__controls--left{float:left}.plyr__controls--right{float:right;margin-top:0}}.plyr__controls button{display:inline-block;vertical-align:middle;margin:0 2px;padding:5px 10px;overflow:hidden;border:0;background:0 0;border-radius:3px;cursor:pointer;color:#6B7D86;transition:background .3s ease,color .3s ease,opacity .3s ease}.plyr__controls button svg{width:18px;height:18px;display:block;fill:currentColor;transition:fill .3s ease}.plyr__controls button.tab-focus:focus,.plyr__controls button:hover{background:#3498DB;color:#fff}.plyr__controls .plyr__time,.plyr__tooltip{color:#6B7D86;font-size:14px;font-weight:600}.plyr__controls button:focus{outline:0}.plyr__controls .icon--captions-on,.plyr__controls .icon--exit-fullscreen,.plyr__controls .icon--muted{display:none}.plyr__controls .plyr__time{display:inline-block;vertical-align:middle;margin-left:10px}.plyr__controls .plyr__time+.plyr__time{display:none}@media (min-width:560px){.plyr__controls .plyr__time+.plyr__time{display:inline-block}}.plyr__controls .plyr__time+.plyr__time::before{content:'\2044';margin-right:10px}.plyr__tooltip{position:absolute;z-index:2;bottom:100%;margin-bottom:10px;padding:10px 15px;opacity:0;background:#fff;box-shadow:0 0 5px rgba(52,63,74,.1),0 0 0 1px rgba(52,63,74,.1);border-radius:3px;line-height:1.5;-webkit-transform:translate(-50%,30px) scale(.8);transform:translate(-50%,30px) scale(.8);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;transition:opacity .2s .1s ease,-webkit-transform .2s .1s ease;transition:transform .2s .1s ease,opacity .2s .1s ease;transition:transform .2s .1s ease,opacity .2s .1s ease,-webkit-transform .2s .1s ease}.plyr__tooltip::after,.plyr__tooltip::before{content:'';position:absolute;width:0;height:0;top:100%;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.plyr__tooltip::after{bottom:-8px;border-right:7px solid transparent;border-top:7px solid rgba(52,63,74,.1);border-left:7px solid transparent;z-index:1}.plyr__tooltip::before{bottom:-6px;border-right:6px solid transparent;border-top:6px solid #fff;border-left:6px solid transparent;z-index:2}.plyr button.tab-focus:focus .plyr__tooltip,.plyr button:hover .plyr__tooltip{opacity:1;-webkit-transform:translate(-50%,0) scale(1);transform:translate(-50%,0) scale(1)}.plyr button:hover .plyr__tooltip{z-index:3}.plyr input[type=range].tab-focus:focus{outline:rgba(52,63,74,.8) dotted 1px;outline-offset:3px}.plyr__progress--seek[type=range]:focus,.plyr__volume[type=range]:focus{outline:0}.plyr__progress{position:absolute;bottom:100%;left:0;right:0;width:100%;height:10px;background:rgba(86,93,100,.2)}.plyr__progress--buffer[value],.plyr__progress--played[value],.plyr__progress--seek[type=range]{position:absolute;left:0;top:0;width:100%;height:10px;margin:0;padding:0;vertical-align:top;-webkit-appearance:none;-moz-appearance:none;border:none;background:0 0}.plyr__progress--buffer[value]::-webkit-progress-bar,.plyr__progress--played[value]::-webkit-progress-bar{background:0 0}.plyr__progress--buffer[value]::-webkit-progress-value,.plyr__progress--played[value]::-webkit-progress-value{background:currentColor}.plyr__progress--buffer[value]::-moz-progress-bar,.plyr__progress--played[value]::-moz-progress-bar{background:currentColor}.plyr__progress--played[value]{z-index:2;color:#3498DB}.plyr__progress--buffer[value]{color:rgba(86,93,100,.25)}.plyr__progress--seek[type=range]{z-index:4;cursor:pointer;outline:0}.plyr__progress--seek[type=range]::-webkit-slider-runnable-track{background:0 0;border:0}.plyr__progress--seek[type=range]::-webkit-slider-thumb{-webkit-appearance:none;background:0 0;border:0;width:40px;height:10px;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.plyr__progress--seek[type=range]::-moz-range-track{background:0 0;border:0}.plyr__progress--seek[type=range]::-moz-range-thumb{-moz-appearance:none;background:0 0;border:0;width:40px;height:10px;transform:translateX(-50%)}.plyr__progress--seek[type=range]::-ms-track{color:transparent;background:0 0;border:0}.plyr__progress--seek[type=range]::-ms-fill-lower,.plyr__progress--seek[type=range]::-ms-fill-upper{background:0 0;border:0}.plyr__progress--seek[type=range]::-ms-thumb{background:0 0;border:0;width:40px;height:10px;transform:translateX(-50%)}.plyr__progress--seek[type=range]::-moz-focus-outer{border:0}.plyr--loading .plyr__progress--buffer{-webkit-animation:progress 1s linear infinite;animation:progress 1s linear infinite;background-size:40px 40px;background-repeat:repeat-x;background-color:rgba(86,93,100,.25);background-image:linear-gradient(-45deg,rgba(0,0,0,.15) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.15) 50%,rgba(0,0,0,.15) 75%,transparent 75%,transparent);color:transparent}.plyr--playing .plyr__controls [data-plyr=play],.plyr__controls [data-plyr=pause]{display:none}.plyr--playing .plyr__controls [data-plyr=pause]{display:inline-block}.plyr__volume[type=range]{display:inline-block;vertical-align:middle;-webkit-appearance:none;-moz-appearance:none;width:100px;margin:0 10px 0 0;padding:0;cursor:pointer;background:0 0;border:none}.plyr__volume[type=range]::-webkit-slider-runnable-track{height:6px;background:#e6e6e6;border:0;border-radius:3px}.plyr__volume[type=range]::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-3px;height:12px;width:12px;background:#6B7D86;border:0;border-radius:100%;transition:background .3s ease;cursor:ew-resize}.plyr__volume[type=range]::-moz-range-track{height:6px;background:#e6e6e6;border:0;border-radius:3px}.plyr__volume[type=range]::-moz-range-thumb{height:12px;width:12px;background:#6B7D86;border:0;border-radius:100%;transition:background .3s ease;cursor:ew-resize}.plyr__volume[type=range]::-ms-track{height:6px;background:0 0;border-color:transparent;border-width:3px 0;color:transparent}.plyr__volume[type=range]::-ms-fill-lower,.plyr__volume[type=range]::-ms-fill-upper{height:6px;background:#e6e6e6;border:0;border-radius:3px}.plyr__volume[type=range]::-ms-thumb{height:12px;width:12px;background:#6B7D86;border:0;border-radius:100%;transition:background .3s ease;cursor:ew-resize}.plyr__volume[type=range]:focus::-webkit-slider-thumb{background:#3498DB}.plyr__volume[type=range]:focus::-moz-range-thumb{background:#3498DB}.plyr__volume[type=range]:focus::-ms-thumb{background:#3498DB}.plyr--is-ios .plyr__volume,.plyr--is-ios [data-plyr=mute],.plyr--is-ios.plyr--audio .plyr__controls--right{display:none}.plyr--is-ios.plyr--audio .plyr__controls--left{float:none}.plyr--audio .plyr__controls{padding-top:20px}.plyr--audio .plyr__progress{bottom:auto;top:0;background:#D6DADD}.plyr--fullscreen,.plyr--fullscreen-active{position:fixed;top:0;left:0;right:0;bottom:0;height:100%;width:100%;z-index:10000000;background:#000}.plyr--fullscreen video,.plyr--fullscreen-active video{height:100%}.plyr--fullscreen .plyr__video-wrapper,.plyr--fullscreen-active .plyr__video-wrapper{height:100%;width:100%}.plyr--fullscreen .plyr__controls,.plyr--fullscreen-active .plyr__controls{position:absolute;bottom:0;left:0;right:0}.plyr--fullscreen--hide-controls.plyr--fullscreen-active.plyr--playing .plyr__controls{-webkit-transform:translateY(100%) translateY(5px);transform:translateY(100%) translateY(5px);transition:-webkit-transform .3s .2s ease;transition:transform .3s .2s ease;transition:transform .3s .2s ease,-webkit-transform .3s .2s ease}.plyr--fullscreen--hide-controls.plyr--fullscreen-active.plyr--playing.plyr--hover .plyr__controls{-webkit-transform:translateY(0);transform:translateY(0)}.plyr--fullscreen--hide-controls.plyr--fullscreen-active.plyr--playing .plyr__captions{bottom:5px;transition:bottom .3s .2s ease}.plyr--fullscreen .plyr__captions,.plyr--fullscreen--hide-controls.plyr--fullscreen-active.plyr--playing.plyr--hover .plyr__captions,.plyr--fullscreen-active .plyr__captions{top:auto;bottom:90px}@media (min-width:560px){.plyr--fullscreen .plyr__captions,.plyr--fullscreen--hide-controls.plyr--fullscreen-active.plyr--playing.plyr--hover .plyr__captions,.plyr--fullscreen-active .plyr__captions{bottom:60px}}.plyr--captions-active .plyr__controls .icon--captions-on,.plyr--fullscreen-active .icon--exit-fullscreen,.plyr--muted .plyr__controls .icon--muted{display:block}.plyr [data-plyr=captions],.plyr [data-plyr=fullscreen],.plyr--captions-active .plyr__controls .icon--captions-on+svg,.plyr--fullscreen-active .icon--exit-fullscreen+svg,.plyr--muted .plyr__controls .icon--muted+svg{display:none}.plyr--captions-enabled [data-plyr=captions],.plyr--fullscreen-enabled [data-plyr=fullscreen]{display:inline-block} \ No newline at end of file +.plyr__captions,.plyr__controls{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-align:center}@-webkit-keyframes plyr-progress{to{background-position:40px 0}}@keyframes plyr-progress{to{background-position:40px 0}}.plyr{position:relative;max-width:100%;min-width:290px}.plyr,.plyr *,.plyr ::after,.plyr ::before{box-sizing:border-box}.plyr a,.plyr button,.plyr input,.plyr label{-ms-touch-action:manipulation;touch-action:manipulation}.plyr__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}.plyr__video-wrapper{position:relative}.plyr audio,.plyr video{width:100%;height:auto;vertical-align:middle}.plyr__video-embed{padding-bottom:56.25%;height:0;overflow:hidden;background:#000}.plyr__video-embed iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.plyr__video-embed>div{position:relative;padding-bottom:200%;-webkit-transform:translateY(-35.95%);transform:translateY(-35.95%)}.plyr__captions{display:none;position:absolute;bottom:0;left:0;width:100%;padding:20px 20px 30px;color:#fff;font-size:20px}.plyr__captions span{border-radius:2px;padding:3px 10px;background:rgba(0,0,0,.9)}.plyr__captions span:empty{display:none}@media (min-width:768px){.plyr__captions{font-size:24px}}.plyr--captions-active .plyr__captions{display:block}.plyr--fullscreen-active .plyr__captions{font-size:32px}.plyr__controls{position:relative;padding:10px;background:#fff;line-height:1;box-shadow:0 1px 1px rgba(52,63,74,.2)}.plyr__controls::after{content:'';display:table;clear:both}.plyr__controls--right{display:block;margin:10px auto 0}@media (min-width:560px){.plyr__controls--left{float:left}.plyr__controls--right{float:right;margin-top:0}}.plyr__controls button{display:inline-block;vertical-align:middle;margin:0 2px;padding:5px 10px;overflow:hidden;border:0;background:0 0;border-radius:3px;cursor:pointer;color:#6B7D86;transition:background .3s ease,color .3s ease,opacity .3s ease}.plyr__controls button svg{width:18px;height:18px;display:block;fill:currentColor;transition:fill .3s ease}.plyr__controls button.tab-focus:focus,.plyr__controls button:hover{background:#3498DB;color:#fff}.plyr__controls .plyr__time,.plyr__tooltip{color:#6B7D86;font-size:14px;font-weight:600}.plyr__controls button:focus{outline:0}.plyr__controls .icon--captions-on,.plyr__controls .icon--exit-fullscreen,.plyr__controls .icon--muted{display:none}.plyr__controls .plyr__time{display:inline-block;vertical-align:middle;margin-left:10px}.plyr__controls .plyr__time+.plyr__time{display:none}@media (min-width:560px){.plyr__controls .plyr__time+.plyr__time{display:inline-block}}.plyr__controls .plyr__time+.plyr__time::before{content:'\2044';margin-right:10px}.plyr__tooltip{position:absolute;z-index:2;bottom:100%;margin-bottom:10px;padding:10px 15px;opacity:0;background:#fff;box-shadow:0 0 5px rgba(52,63,74,.1),0 0 0 1px rgba(52,63,74,.1);border-radius:3px;line-height:1.5;-webkit-transform:translate(-50%,30px) scale(.8);transform:translate(-50%,30px) scale(.8);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;transition:opacity .2s .1s ease,-webkit-transform .2s .1s ease;transition:transform .2s .1s ease,opacity .2s .1s ease;transition:transform .2s .1s ease,opacity .2s .1s ease,-webkit-transform .2s .1s ease}.plyr__tooltip::after,.plyr__tooltip::before{content:'';position:absolute;width:0;height:0;top:100%;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.plyr__tooltip::after{bottom:-8px;border-right:7px solid transparent;border-top:7px solid rgba(52,63,74,.1);border-left:7px solid transparent;z-index:1}.plyr__tooltip::before{bottom:-6px;border-right:6px solid transparent;border-top:6px solid #fff;border-left:6px solid transparent;z-index:2}.plyr button.tab-focus:focus .plyr__tooltip,.plyr button:hover .plyr__tooltip{opacity:1;-webkit-transform:translate(-50%,0) scale(1);transform:translate(-50%,0) scale(1)}.plyr button:hover .plyr__tooltip{z-index:3}.plyr input[type=range].tab-focus:focus{outline:rgba(52,63,74,.8) dotted 1px;outline-offset:3px}.plyr__progress--seek[type=range]:focus,.plyr__volume[type=range]:focus{outline:0}.plyr__progress{position:absolute;bottom:100%;left:0;right:0;width:100%;height:10px;background:rgba(86,93,100,.2)}.plyr__progress--buffer[value],.plyr__progress--played[value],.plyr__progress--seek[type=range]{position:absolute;left:0;top:0;width:100%;height:10px;margin:0;padding:0;vertical-align:top;-webkit-appearance:none;-moz-appearance:none;border:none;background:0 0}.plyr__progress--buffer[value]::-webkit-progress-bar,.plyr__progress--played[value]::-webkit-progress-bar{background:0 0}.plyr__progress--buffer[value]::-webkit-progress-value,.plyr__progress--played[value]::-webkit-progress-value{background:currentColor}.plyr__progress--buffer[value]::-moz-progress-bar,.plyr__progress--played[value]::-moz-progress-bar{background:currentColor}.plyr__progress--played[value]{z-index:2;color:#3498DB}.plyr__progress--buffer[value]{color:rgba(86,93,100,.25)}.plyr__progress--seek[type=range]{z-index:4;cursor:pointer;outline:0}.plyr__progress--seek[type=range]::-webkit-slider-runnable-track{background:0 0;border:0}.plyr__progress--seek[type=range]::-webkit-slider-thumb{-webkit-appearance:none;background:0 0;border:0;width:40px;height:10px;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.plyr__progress--seek[type=range]::-moz-range-track{background:0 0;border:0}.plyr__progress--seek[type=range]::-moz-range-thumb{-moz-appearance:none;background:0 0;border:0;width:40px;height:10px;transform:translateX(-50%)}.plyr__progress--seek[type=range]::-ms-track{color:transparent;background:0 0;border:0}.plyr__progress--seek[type=range]::-ms-fill-lower,.plyr__progress--seek[type=range]::-ms-fill-upper{background:0 0;border:0}.plyr__progress--seek[type=range]::-ms-thumb{background:0 0;border:0;width:40px;height:10px;transform:translateX(-50%)}.plyr__progress--seek[type=range]::-moz-focus-outer{border:0}.plyr--loading .plyr__progress--buffer{-webkit-animation:plyr-progress 1s linear infinite;animation:plyr-progress 1s linear infinite;background-size:40px 40px;background-repeat:repeat-x;background-color:rgba(86,93,100,.25);background-image:linear-gradient(-45deg,rgba(0,0,0,.15) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.15) 50%,rgba(0,0,0,.15) 75%,transparent 75%,transparent);color:transparent}.plyr--playing .plyr__controls [data-plyr=play],.plyr__controls [data-plyr=pause]{display:none}.plyr--playing .plyr__controls [data-plyr=pause]{display:inline-block}.plyr__volume[type=range]{display:inline-block;vertical-align:middle;-webkit-appearance:none;-moz-appearance:none;width:100px;margin:0 10px 0 0;padding:0;cursor:pointer;background:0 0;border:none}.plyr__volume[type=range]::-webkit-slider-runnable-track{height:6px;background:#e6e6e6;border:0;border-radius:3px}.plyr__volume[type=range]::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-3px;height:12px;width:12px;background:#6B7D86;border:0;border-radius:100%;transition:background .3s ease;cursor:ew-resize}.plyr__volume[type=range]::-moz-range-track{height:6px;background:#e6e6e6;border:0;border-radius:3px}.plyr__volume[type=range]::-moz-range-thumb{height:12px;width:12px;background:#6B7D86;border:0;border-radius:100%;transition:background .3s ease;cursor:ew-resize}.plyr__volume[type=range]::-ms-track{height:6px;background:0 0;border-color:transparent;border-width:3px 0;color:transparent}.plyr__volume[type=range]::-ms-fill-lower,.plyr__volume[type=range]::-ms-fill-upper{height:6px;background:#e6e6e6;border:0;border-radius:3px}.plyr__volume[type=range]::-ms-thumb{height:12px;width:12px;background:#6B7D86;border:0;border-radius:100%;transition:background .3s ease;cursor:ew-resize}.plyr__volume[type=range]:focus::-webkit-slider-thumb{background:#3498DB}.plyr__volume[type=range]:focus::-moz-range-thumb{background:#3498DB}.plyr__volume[type=range]:focus::-ms-thumb{background:#3498DB}.plyr--is-ios .plyr__volume,.plyr--is-ios [data-plyr=mute],.plyr--is-ios.plyr--audio .plyr__controls--right{display:none}.plyr--is-ios.plyr--audio .plyr__controls--left{float:none}.plyr--audio .plyr__controls{padding-top:20px}.plyr--audio .plyr__progress{bottom:auto;top:0;background:#D6DADD}.plyr--fullscreen,.plyr--fullscreen-active{position:fixed;top:0;left:0;right:0;bottom:0;height:100%;width:100%;z-index:10000000;background:#000}.plyr--fullscreen video,.plyr--fullscreen-active video{height:100%}.plyr--fullscreen .plyr__video-wrapper,.plyr--fullscreen-active .plyr__video-wrapper{height:100%;width:100%}.plyr--fullscreen .plyr__controls,.plyr--fullscreen-active .plyr__controls{position:absolute;bottom:0;left:0;right:0}.plyr--fullscreen--hide-controls.plyr--fullscreen-active.plyr--playing .plyr__controls{-webkit-transform:translateY(100%) translateY(5px);transform:translateY(100%) translateY(5px);transition:-webkit-transform .3s .2s ease;transition:transform .3s .2s ease;transition:transform .3s .2s ease,-webkit-transform .3s .2s ease}.plyr--fullscreen--hide-controls.plyr--fullscreen-active.plyr--playing.plyr--hover .plyr__controls{-webkit-transform:translateY(0);transform:translateY(0)}.plyr--fullscreen--hide-controls.plyr--fullscreen-active.plyr--playing .plyr__captions{bottom:5px;transition:bottom .3s .2s ease}.plyr--fullscreen .plyr__captions,.plyr--fullscreen--hide-controls.plyr--fullscreen-active.plyr--playing.plyr--hover .plyr__captions,.plyr--fullscreen-active .plyr__captions{top:auto;bottom:90px}@media (min-width:560px){.plyr--fullscreen .plyr__captions,.plyr--fullscreen--hide-controls.plyr--fullscreen-active.plyr--playing.plyr--hover .plyr__captions,.plyr--fullscreen-active .plyr__captions{bottom:60px}}.plyr--captions-active .plyr__controls .icon--captions-on,.plyr--fullscreen-active .icon--exit-fullscreen,.plyr--muted .plyr__controls .icon--muted{display:block}.plyr [data-plyr=captions],.plyr [data-plyr=fullscreen],.plyr--captions-active .plyr__controls .icon--captions-on+svg,.plyr--fullscreen-active .icon--exit-fullscreen+svg,.plyr--muted .plyr__controls .icon--muted+svg{display:none}.plyr--captions-enabled [data-plyr=captions],.plyr--fullscreen-enabled [data-plyr=fullscreen]{display:inline-block} \ No newline at end of file diff --git a/src/less/plyr.less b/src/less/plyr.less index fde725d7..955bd824 100644 --- a/src/less/plyr.less +++ b/src/less/plyr.less @@ -7,78 +7,78 @@ // ------------------------------- // Colors -@blue: #3498DB; -@gray-dark: #343F4A; -@gray: #565D64; -@gray-light: #6B7D86; -@gray-lighter: #CBD0D3; -@off-white: #D6DADD; +@plyr-blue: #3498DB; +@plyr-gray-dark: #343F4A; +@plyr-gray: #565D64; +@plyr-gray-light: #6B7D86; +@plyr-gray-lighter: #CBD0D3; +@plyr-off-white: #D6DADD; // Font sizes -@font-size-small: 14px; -@font-size-base: 16px; +@plyr-font-size-small: 14px; +@plyr-font-size-base: 16px; // Captions -@font-size-captions-base: ceil(@font-size-base * 1.25); -@font-size-captions-medium: ceil(@font-size-base * 1.5); -@font-size-captions-large: (@font-size-base * 2); +@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 -@control-spacing: 10px; -@controls-bg: #fff; -@control-bg-hover: @blue; -.contrast-control-color(@controls-bg); -.contrast-control-color-hover(@control-bg-hover); +@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 -@tooltip-bg: @controls-bg; -@tooltip-border-color: fade(@gray-dark, 10%); -@tooltip-border-width: 1px; -@tooltip-shadow: 0 0 5px @tooltip-border-color, 0 0 0 @tooltip-border-width @tooltip-border-color; -@tooltip-color: @control-color; -@tooltip-padding: @control-spacing; -@tooltip-arrow-size: 6px; -@tooltip-radius: 3px; +@plyr-tooltip-bg: @plyr-controls-bg; +@plyr-tooltip-border-color: fade(@plyr-gray-dark, 10%); +@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 -@progress-bg: fade(@gray, 20%); -@progress-playing-bg: @blue; -@progress-buffered-bg: fade(@gray, 25%); -@progress-loading-size: 40px; -@progress-loading-bg: rgba(0,0,0, .15); +@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 -@volume-track-height: 6px; -@volume-track-bg: darken(@controls-bg, 10%); -@volume-thumb-height: (@volume-track-height * 2); -@volume-thumb-width: (@volume-track-height * 2); -@volume-thumb-bg: @control-color; -@volume-thumb-bg-focus: @control-bg-hover; +@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 -@bp-control-split: 560px; // When controls split into left/right -@bp-captions-large: 768px; // When captions jump to the larger font size +@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 progress { - to { background-position: @progress-loading-size 0; } +@keyframes plyr-progress { + to { background-position: @plyr-progress-loading-size 0; } } // Mixins // ------------------------------- // Contrast -.contrast-control-color(@color: "") when (lightness(@color) >= 65%) { - @control-color: @gray-light; +.contrast-control-color(@plyr-color: "") when (lightness(@plyr-color) >= 65%) { + @plyr-control-color: @plyr-gray-light; } -.contrast-control-color(@color: "") when (lightness(@color) < 65%) { - @control-color: @gray-lighter; +.contrast-control-color(@plyr-color: "") when (lightness(@plyr-color) < 65%) { + @plyr-control-color: @plyr-gray-lighter; } -.contrast-control-color-hover(@color: "") when (lightness(@color) >= 65%) { - @control-color-hover: @gray; +.contrast-control-color-hover(@plyr-color: "") when (lightness(@plyr-color) >= 65%) { + @plyr-control-color-hover: @plyr-gray; } -.contrast-control-color-hover(@color: "") when (lightness(@color) < 65%) { - @control-color-hover: #fff; +.contrast-control-color-hover(@plyr-color: "") when (lightness(@plyr-color) < 65%) { + @plyr-control-color-hover: #fff; } // Font smoothing @@ -91,40 +91,27 @@ -webkit-font-smoothing: subpixel-antialiased; } -// Contain floats: nicolasgallagher.com/micro-clearfix-hack/ -.clearfix() { - zoom: 1; - &:before, - &:after { content: ""; display: table; } - &:after { clear: both; } -} -// Tab focus styles -.tab-focus() { - outline: 1px dotted fade(@gray-dark, 80%); - outline-offset: 3px; -} - // styling .volume-thumb() { - height: @volume-thumb-height; - width: @volume-thumb-width; - background: @volume-thumb-bg; + 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: @volume-track-height; - background: @volume-track-bg; + height: @plyr-volume-track-height; + background: @plyr-volume-track-bg; border: 0; - border-radius: (@volume-track-height / 2); + border-radius: (@plyr-volume-track-height / 2); } .seek-thumb() { background: transparent; border: 0; - width: (@control-spacing * 4); - height: @control-spacing; + width: (@plyr-control-spacing * 4); + height: @plyr-control-spacing; transform: translateX(-50%); } .seek-track() { @@ -208,49 +195,55 @@ bottom: 0; left: 0; width: 100%; - padding: (@control-spacing * 2) (@control-spacing * 2) (@control-spacing * 3); + padding: (@plyr-control-spacing * 2) (@plyr-control-spacing * 2) (@plyr-control-spacing * 3); color: #fff; - font-size: @font-size-captions-base; + font-size: @plyr-font-size-captions-base; text-align: center; .font-smoothing(); span { border-radius: 2px; padding: 3px 10px; - background: rgba(0,0,0, .9); + background: fade(#000, 90%); } span:empty { display: none; } - @media (min-width: @bp-captions-large) { - font-size: @font-size-captions-medium; + @media (min-width: @plyr-bp-captions-large) { + font-size: @plyr-font-size-captions-medium; } } &--captions-active &__captions { display: block; } &--fullscreen-active &__captions { - font-size: @font-size-captions-large; + font-size: @plyr-font-size-captions-large; } // Playback controls &__controls { - .clearfix(); .font-smoothing(); position: relative; - padding: @control-spacing; - background: @controls-bg; + padding: @plyr-control-spacing; + background: @plyr-controls-bg; line-height: 1; text-align: center; - box-shadow: 0 1px 1px fade(@gray-dark, 20%); + box-shadow: 0 1px 1px fade(@plyr-gray-dark, 20%); + + // Clear floats + &::after { + content: ''; + display: table; + clear: both; + } // Layout &--right { display: block; - margin: @control-spacing auto 0; + margin: @plyr-control-spacing auto 0; } - @media (min-width: @bp-control-split) { + @media (min-width: @plyr-bp-control-split) { &--left { float: left; } @@ -265,13 +258,13 @@ display: inline-block; vertical-align: middle; margin: 0 2px; - padding: (@control-spacing / 2) @control-spacing; + padding: (@plyr-control-spacing / 2) @plyr-control-spacing; overflow: hidden; border: 0; background: transparent; border-radius: 3px; cursor: pointer; - color: @control-color; + color: @plyr-control-color; transition: background .3s ease, color .3s ease, opacity .3s ease; svg { @@ -285,8 +278,8 @@ // Hover and tab focus &.tab-focus:focus, &:hover { - background: @control-bg-hover; - color: @control-color-hover; + background: @plyr-control-bg-hover; + color: @plyr-control-color-hover; } // Default focus &:focus { @@ -305,24 +298,24 @@ .plyr__time { display: inline-block; vertical-align: middle; - margin-left: @control-spacing; - color: @control-color; + margin-left: @plyr-control-spacing; + color: @plyr-control-color; font-weight: 600; - font-size: @font-size-small; + font-size: @plyr-font-size-small; } // Media duration hidden on small screens .plyr__time + .plyr__time { display: none; - @media (min-width: @bp-control-split) { + @media (min-width: @plyr-bp-control-split) { display: inline-block; } // Add a slash in before &::before { content: '\2044'; - margin-right: @control-spacing; + margin-right: @plyr-control-spacing; } } } @@ -332,19 +325,19 @@ position: absolute; z-index: 2; bottom: 100%; - margin-bottom: @tooltip-padding; - padding: @tooltip-padding (@tooltip-padding * 1.5); + margin-bottom: @plyr-tooltip-padding; + padding: @plyr-tooltip-padding (@plyr-tooltip-padding * 1.5); opacity: 0; - background: @tooltip-bg; - box-shadow: @tooltip-shadow; - border-radius: @tooltip-radius; - color: @tooltip-color; - font-size: @font-size-small; + 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%, (@tooltip-padding * 3)) scale(.8); + transform: translate(-50%, (@plyr-tooltip-padding * 3)) scale(.8); transform-origin: 50% 100%; transition: transform .2s .1s ease, opacity .2s .1s ease; @@ -361,19 +354,19 @@ } // The border triangle &::after { - @border-arrow-size: (@tooltip-arrow-size + (@tooltip-border-width * 1)); - bottom: -(@border-arrow-size + @tooltip-border-width); - border-right: @border-arrow-size solid transparent; - border-top: @border-arrow-size solid @tooltip-border-color; - border-left: @border-arrow-size solid transparent; + @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-border-color; + border-left: @plyr-border-arrow-size solid transparent; z-index: 1; } // The background triangle &::before { - bottom: -@tooltip-arrow-size; - border-right: @tooltip-arrow-size solid transparent; - border-top: @tooltip-arrow-size solid @tooltip-bg; - border-left: @tooltip-arrow-size solid transparent; + 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; } } @@ -388,7 +381,8 @@ // Common range styles input[type='range'].tab-focus:focus { - .tab-focus(); + outline: 1px dotted fade(@plyr-gray-dark, 80%); + outline-offset: 3px; } // Playback progress @@ -399,8 +393,8 @@ left: 0; right: 0; width: 100%; - height: @control-spacing; - background: @progress-bg; + height: @plyr-control-spacing; + background: @plyr-progress-bg; &--buffer[value], &--played[value], @@ -409,7 +403,7 @@ left: 0; top: 0; width: 100%; - height: @control-spacing; + height: @plyr-control-spacing; margin: 0; padding: 0; vertical-align: top; @@ -435,10 +429,10 @@ } &--played[value] { z-index: 2; - color: @progress-playing-bg; + color: @plyr-progress-playing-bg; } &--buffer[value] { - color: @progress-buffered-bg; + color: @plyr-progress-buffered-bg; } // Seek control @@ -491,17 +485,17 @@ // Loading state &--loading .plyr__progress--buffer { - animation: progress 1s linear infinite; - background-size: @progress-loading-size @progress-loading-size; + animation: plyr-progress 1s linear infinite; + background-size: @plyr-progress-loading-size @plyr-progress-loading-size; background-repeat: repeat-x; - background-color: @progress-buffered-bg; + background-color: @plyr-progress-buffered-bg; background-image: linear-gradient( -45deg, - @progress-loading-bg 25%, + @plyr-progress-loading-bg 25%, transparent 25%, transparent 50%, - @progress-loading-bg 50%, - @progress-loading-bg 75%, + @plyr-progress-loading-bg 50%, + @plyr-progress-loading-bg 75%, transparent 75%, transparent); color: transparent; @@ -525,7 +519,7 @@ -webkit-appearance: none; -moz-appearance: none; width: 100px; - margin: 0 @control-spacing 0 0; + margin: 0 @plyr-control-spacing 0 0; padding: 0; cursor: pointer; background: transparent; @@ -537,7 +531,7 @@ } &::-webkit-slider-thumb { -webkit-appearance: none; - margin-top: -((@volume-thumb-height - @volume-track-height) / 2); + margin-top: -((@plyr-volume-thumb-height - @plyr-volume-track-height) / 2); .volume-thumb(); } @@ -551,10 +545,10 @@ // Microsoft &::-ms-track { - height: @volume-track-height; + height: @plyr-volume-track-height; background: transparent; border-color: transparent; - border-width: ((@volume-thumb-height - @volume-track-height) / 2) 0; + border-width: ((@plyr-volume-thumb-height - @plyr-volume-track-height) / 2) 0; color: transparent; } &::-ms-fill-lower, @@ -569,13 +563,13 @@ outline: 0; &::-webkit-slider-thumb { - background: @volume-thumb-bg-focus; + background: @plyr-volume-thumb-bg-focus; } &::-moz-range-thumb { - background: @volume-thumb-bg-focus; + background: @plyr-volume-thumb-bg-focus; } &::-ms-thumb { - background: @volume-thumb-bg-focus; + background: @plyr-volume-thumb-bg-focus; } } } @@ -596,12 +590,12 @@ // Audio specific styles // Position the progress within the container &--audio .plyr__controls { - padding-top: (@control-spacing * 2); + padding-top: (@plyr-control-spacing * 2); } &--audio .plyr__progress { bottom: auto; top: 0; - background: @off-white; + background: @plyr-off-white; } // Full screen mode @@ -635,14 +629,14 @@ // Hide controls when playing in full screen &--fullscreen--hide-controls&--fullscreen-active&--playing { .plyr__controls { - transform: translateY(100%) translateY(@control-spacing / 2); + transform: translateY(100%) translateY(@plyr-control-spacing / 2); transition: transform .3s .2s ease; } &.plyr--hover .plyr__controls { transform: translateY(0); } .plyr__captions { - bottom: (@control-spacing / 2); + bottom: (@plyr-control-spacing / 2); transition: bottom .3s .2s ease; } } @@ -654,7 +648,7 @@ top: auto; bottom: 90px; - @media (min-width: @bp-control-split) { + @media (min-width: @plyr-bp-control-split) { bottom: 60px; } } diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss index 8bf481db..bbd52579 100644 --- a/src/sass/plyr.scss +++ b/src/sass/plyr.scss @@ -7,76 +7,76 @@ // ------------------------------- // Colors -$blue: #3498DB !default; -$gray-dark: #343F4A !default; -$gray: #565D64 !default; -$gray-light: #6B7D86 !default; -$gray-lighter: #CBD0D3 !default; -$off-white: #D6DADD !default; +$plyr-blue: #3498DB !default; +$plyr-gray-dark: #343F4A !default; +$plyr-gray: #565D64 !default; +$plyr-gray-light: #6B7D86 !default; +$plyr-gray-lighter: #CBD0D3 !default; +$plyr-off-white: #D6DADD !default; // Font sizes -$font-size-small: 14px !default; -$font-size-base: 16px !default; +$plyr-font-size-small: 14px !default; +$plyr-font-size-base: 16px !default; // Captions -$font-size-captions-base: ceil($font-size-base * 1.25) !default; -$font-size-captions-medium: ceil($font-size-base * 1.5) !default; -$font-size-captions-large: ($font-size-base * 2) !default; +$plyr-font-size-captions-base: ceil($plyr-font-size-base * 1.25) !default; +$plyr-font-size-captions-medium: ceil($plyr-font-size-base * 1.5) !default; +$plyr-font-size-captions-large: ($plyr-font-size-base * 2) !default; // Controls -$control-spacing: 10px !default; -$controls-bg: #fff !default; -$control-bg-hover: $blue !default; -$control-color: null !default; -$control-color-hover: null !default; +$plyr-control-spacing: 10px !default; +$plyr-controls-bg: #fff !default; +$plyr-control-bg-hover: $plyr-blue !default; +$plyr-control-color: null !default; +$plyr-control-color-hover: null !default; // Contrast -@if lightness($controls-bg) >= 65% { - $control-color: $gray-light; +@if lightness($plyr-controls-bg) >= 65% { + $plyr-control-color: $plyr-gray-light; } @else { - $control-color: $gray-lighter; + $plyr-control-color: $plyr-gray-lighter; } -@if lightness($control-bg-hover) >= 65% { - $control-color-hover: $gray; +@if lightness($plyr-control-bg-hover) >= 65% { + $plyr-control-color-hover: $plyr-gray; } @else { - $control-color-hover: #fff; + $plyr-control-color-hover: #fff; } // Tooltips -$tooltip-bg: $controls-bg !default; -$tooltip-border-color: transparentize(@gray-dark, .1) !default; -$tooltip-border-width: 1px; -$tooltip-shadow: 0 0 5px $tooltip-border-color, 0 0 0 $tooltip-border-width $tooltip-border-color; -$tooltip-color: $control-color !default; -$tooltip-padding: $control-spacing !default; -$tooltip-arrow-size: 6px !default; -$tooltip-radius: 3px !default; +$plyr-tooltip-bg: $plyr-controls-bg !default; +$plyr-tooltip-border-color: transparentize(@gray-dark, .1) !default; +$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 !default; +$plyr-tooltip-padding: $plyr-control-spacing !default; +$plyr-tooltip-arrow-size: 6px !default; +$plyr-tooltip-radius: 3px !default; // Progress -$progress-bg: transparentize($gray, .2) !default; -$progress-playing-bg: $blue !default; -$progress-buffered-bg: transparentize($gray, .25) !default; -$progress-loading-size: 40px !default; -$progress-loading-bg: rgba(0,0,0, .15) !default; +$plyr-progress-bg: transparentize($plyr-gray, .2) !default; +$plyr-progress-playing-bg: $plyr-blue !default; +$plyr-progress-buffered-bg: transparentize($plyr-gray, .25) !default; +$plyr-progress-loading-size: 40px !default; +$plyr-progress-loading-bg: transparentize(#000, .15); !default; // Volume -$volume-track-height: 6px !default; -$volume-track-bg: darken($controls-bg, 10%) !default; -$volume-thumb-height: ($volume-track-height * 2) !default; -$volume-thumb-width: ($volume-track-height * 2) !default; -$volume-thumb-bg: $control-color !default; -$volume-thumb-bg-focus: $control-bg-hover !default; +$plyr-volume-track-height: 6px !default; +$plyr-volume-track-bg: darken($plyr-controls-bg, 10%) !default; +$plyr-volume-thumb-height: ($plyr-volume-track-height * 2) !default; +$plyr-volume-thumb-width: ($plyr-volume-track-height * 2) !default; +$plyr-volume-thumb-bg: $plyr-control-color !default; +$plyr-volume-thumb-bg-focus: $plyr-control-bg-hover !default; // Breakpoints -$bp-control-split: 560px !default; // When controls split into left/right -$bp-captions-large: 768px !default; // When captions jump to the larger font size +$plyr-bp-control-split: 560px !default; // When controls split into left/right +$plyr-bp-captions-large: 768px !default; // When captions jump to the larger font size // Animation // --------------------------------------- -@keyframes progress { - to { background-position: $progress-loading-size 0; } +@keyframes plyr-progress { + to { background-position: $plyr-progress-loading-size 0; } } // Font smoothing @@ -92,41 +92,27 @@ $bp-captions-large: 768px !default; // When captions jump to the larger } } -// Contain floats: nicolasgallagher.com/micro-clearfix-hack/ -@mixin clearfix() -{ - zoom: 1; - &:before, - &:after { content: ''; display: table; } - &:after { clear: both; } -} -// Tab focus styles -@mixin tab-focus() { - outline: thin dotted transparentize($gray-dark, .8); - outline-offset: 3px; -} - // styling @mixin volume-thumb() { - height: $volume-thumb-height; - width: $volume-thumb-width; - background: $volume-thumb-bg; + 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; } @mixin volume-track() { - height: $volume-track-height; - background: $volume-track-bg; + height: $plyr-volume-track-height; + background: $plyr-volume-track-bg; border: 0; - border-radius: ($volume-track-height / 2); + border-radius: ($plyr-volume-track-height / 2); } @mixin seek-thumb() { background: transparent; border: 0; - width: ($control-spacing * 4); - height: $control-spacing; + width: ($plyr-control-spacing * 4); + height: $plyr-control-spacing; transform: translateX(-50%); } @mixin seek-track() { @@ -209,49 +195,55 @@ $bp-captions-large: 768px !default; // When captions jump to the larger bottom: 0; left: 0; width: 100%; - padding: ($control-spacing * 2) ($control-spacing * 2) ($control-spacing * 3); + padding: ($plyr-control-spacing * 2) ($plyr-control-spacing * 2) ($plyr-control-spacing * 3); color: #fff; - font-size: $font-size-captions-base; + font-size: $plyr-font-size-captions-base; text-align: center; @include font-smoothing(); span { border-radius: 2px; padding: 3px 10px; - background: rgba(0,0,0, .9); + background: transparentize(#000, .9); } span:empty { display: none; } - @media (min-width: $bp-captions-large) { - font-size: $font-size-captions-medium; + @media (min-width: $plyr-bp-captions-large) { + font-size: $plyr-font-size-captions-medium; } } &--captions-active &__captions { display: block; } &--fullscreen-active &__captions { - font-size: $font-size-captions-large; + font-size: $plyr-font-size-captions-large; } // Playback controls &__controls { - @include clearfix(); @include font-smoothing(); position: relative; - padding: $control-spacing; - background: $controls-bg; + padding: $plyr-control-spacing; + background: $plyr-controls-bg; line-height: 1; text-align: center; - box-shadow: 0 1px 1px transparentize($gray-dark, .2); + box-shadow: 0 1px 1px transparentize($plyr-gray-dark, .2); + + // Clear floats + &::after { + content: ''; + display: table; + clear: both; + } // Layout &--right { display: block; - margin: $control-spacing auto 0; + margin: $plyr-control-spacing auto 0; } - @media (min-width: $bp-control-split) { + @media (min-width: $plyr-bp-control-split) { &--left { float: left; } @@ -266,13 +258,13 @@ $bp-captions-large: 768px !default; // When captions jump to the larger display: inline-block; vertical-align: middle; margin: 0 2px; - padding: ($control-spacing / 2) $control-spacing; + padding: ($plyr-control-spacing / 2) $plyr-control-spacing; overflow: hidden; border: 0; background: transparent; border-radius: 3px; cursor: pointer; - color: $control-color; + color: $plyr-control-color; transition: background .3s ease, color .3s ease, opacity .3s ease; svg { @@ -286,8 +278,8 @@ $bp-captions-large: 768px !default; // When captions jump to the larger // Hover and tab focus &.tab-focus:hover, &:hover { - background: $control-bg-hover; - color: $control-color-hover; + background: $plyr-control-bg-hover; + color: $plyr-control-color-hover; } // Default focus &:focus { @@ -306,24 +298,24 @@ $bp-captions-large: 768px !default; // When captions jump to the larger .plyr__time { display: inline-block; vertical-align: middle; - margin-left: $control-spacing; - color: $control-color; + margin-left: $plyr-control-spacing; + color: $plyr-control-color; font-weight: 600; - font-size: $font-size-small; + font-size: $plyr-font-size-small; } // Media duration hidden on small screens .plyr__time + .plyr__time { display: none; - @media (min-width: $bp-control-split) { + @media (min-width: $plyr-bp-control-split) { display: inline-block; } // Add a slash in before &::before { content: '\2044'; - margin-right: $control-spacing; + margin-right: $plyr-control-spacing; } } } @@ -333,19 +325,19 @@ $bp-captions-large: 768px !default; // When captions jump to the larger position: absolute; z-index: 2; bottom: 100%; - margin-bottom: $tooltip-padding; - padding: $tooltip-padding ($tooltip-padding * 1.5); + margin-bottom: $plyr-tooltip-padding; + padding: $plyr-tooltip-padding ($plyr-tooltip-padding * 1.5); opacity: 0; - background: $tooltip-bg; - box-shadow: $tooltip-shadow; - border-radius: $tooltip-radius; - color: $tooltip-color; - font-size: $font-size-small; + 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%, ($tooltip-padding * 3)) scale(.8); + transform: translate(-50%, ($plyr-tooltip-padding * 3)) scale(.8); transform-origin: 50% 100%; transition: transform .2s .1s ease, opacity .2s .1s ease; @@ -362,19 +354,19 @@ $bp-captions-large: 768px !default; // When captions jump to the larger } // The border triangle &::after { - $border-arrow-size: ($tooltip-arrow-size + ($tooltip-border-width * 1)); - bottom: -($border-arrow-size + $tooltip-border-width); - border-right: $border-arrow-size solid transparent; - border-top: $border-arrow-size solid $tooltip-border-color; - border-left: $border-arrow-size solid transparent; + $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-border-color; + border-left: $plyr-border-arrow-size solid transparent; z-index: 1; } // The background triangle &::before { - bottom: -$tooltip-arrow-size; - border-right: $tooltip-arrow-size solid transparent; - border-top: $tooltip-arrow-size solid $tooltip-bg; - border-left: $tooltip-arrow-size solid transparent; + 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; } } @@ -389,7 +381,8 @@ $bp-captions-large: 768px !default; // When captions jump to the larger // Common range styles input[type='range'].tab-focus:focus { - .tab-focus(); + outline: thin dotted transparentize($plyr-gray-dark, .8); + outline-offset: 3px; } // Playback progress @@ -400,8 +393,8 @@ $bp-captions-large: 768px !default; // When captions jump to the larger left: 0; right: 0; width: 100%; - height: $control-spacing; - background: $progress-bg; + height: $plyr-control-spacing; + background: $plyr-progress-bg; &--buffer[value], &--played[value], @@ -410,7 +403,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger left: 0; top: 0; width: 100%; - height: $control-spacing; + height: $plyr-control-spacing; margin: 0; padding: 0; vertical-align: top; @@ -436,10 +429,10 @@ $bp-captions-large: 768px !default; // When captions jump to the larger } &--played[value] { z-index: 2; - color: $progress-playing-bg; + color: $plyr-progress-playing-bg; } &--buffer[value] { - color: $progress-buffered-bg; + color: $plyr-progress-buffered-bg; } // Seek control @@ -492,17 +485,17 @@ $bp-captions-large: 768px !default; // When captions jump to the larger // Loading state &--loading .plyr__progress--buffer { - animation: progress 1s linear infinite; - background-size: $progress-loading-size $progress-loading-size; + animation: plyr-progress 1s linear infinite; + background-size: $plyr-progress-loading-size $plyr-progress-loading-size; background-repeat: repeat-x; - background-color: $progress-buffered-bg; + background-color: $plyr-progress-buffered-bg; background-image: linear-gradient( -45deg, - $progress-loading-bg 25%, + $plyr-progress-loading-bg 25%, transparent 25%, transparent 50%, - $progress-loading-bg 50%, - $progress-loading-bg 75%, + $plyr-progress-loading-bg 50%, + $plyr-progress-loading-bg 75%, transparent 75%, transparent); color: transparent; @@ -526,7 +519,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger -webkit-appearance: none; -moz-appearance: none; width: 100px; - margin: 0 $control-spacing 0 0; + margin: 0 $plyr-control-spacing 0 0; padding: 0; cursor: pointer; background: transparent; @@ -538,7 +531,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger } &::-webkit-slider-thumb { -webkit-appearance: none; - margin-top: -(($volume-thumb-height - $volume-track-height) / 2); + margin-top: -(($plyr-volume-thumb-height - $plyr-volume-track-height) / 2); @include volume-thumb(); } @@ -552,10 +545,10 @@ $bp-captions-large: 768px !default; // When captions jump to the larger // Microsoft &::-ms-track { - height: $volume-track-height; + height: $plyr-volume-track-height; background: transparent; border-color: transparent; - border-width: (($volume-thumb-height - $volume-track-height) / 2) 0; + border-width: (($plyr-volume-thumb-height - $plyr-volume-track-height) / 2) 0; color: transparent; } &::-ms-fill-lower, @@ -570,13 +563,13 @@ $bp-captions-large: 768px !default; // When captions jump to the larger outline: 0; &::-webkit-slider-thumb { - background: $volume-thumb-bg-focus; + background: $plyr-volume-thumb-bg-focus; } &::-moz-range-thumb { - background: $volume-thumb-bg-focus; + background: $plyr-volume-thumb-bg-focus; } &::-ms-thumb { - background: $volume-thumb-bg-focus; + background: $plyr-volume-thumb-bg-focus; } } } @@ -597,12 +590,12 @@ $bp-captions-large: 768px !default; // When captions jump to the larger // Audio specific styles // Position the progress within the container &--audio .plyr__controls { - padding-top: ($control-spacing * 2); + padding-top: ($plyr-control-spacing * 2); } &--audio .plyr__progress { bottom: auto; top: 0; - background: $off-white; + background: $plyr-off-white; } // Full screen mode @@ -635,14 +628,14 @@ $bp-captions-large: 768px !default; // When captions jump to the larger // Hide controls when playing in full screen &--fullscreen--hide-controls&--fullscreen-active&--playing { .plyr__controls { - transform: translateY(100%) translateY($control-spacing / 2); + transform: translateY(100%) translateY($plyr-control-spacing / 2); transition: transform .3s .2s ease; } &.plyr--hover .plyr__controls { transform: translateY(0); } .plyr__captions { - bottom: ($control-spacing / 2); + bottom: ($plyr-control-spacing / 2); transition: bottom .3s .2s ease; } } @@ -654,7 +647,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger top: auto; bottom: 90px; - @media (min-width: $bp-control-split) { + @media (min-width: $plyr-bp-control-split) { bottom: 60px; } }