Adding SCSS settings

- Added setting to be able to disable the border-box if you already defined that in your own css
- Added setting to be able to disable touch-action if you already defined that in your own css
- Added setting to choose not to use !important for sr-only class
This commit is contained in:
Robin Poort 2016-05-11 13:46:40 +02:00
parent 2a822d7b45
commit b23a16826e
2 changed files with 33 additions and 14 deletions

View File

@ -21,6 +21,7 @@
min-width: 200px; min-width: 200px;
font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif; font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
@if $plyr-border-box == true {
// border-box everything // border-box everything
// http://paulirish.com/2012/box-sizing-border-box-ftw/ // http://paulirish.com/2012/box-sizing-border-box-ftw/
&, &,
@ -29,11 +30,14 @@
*::before { *::before {
box-sizing: border-box; box-sizing: border-box;
} }
}
@if $plyr-touch-action == true {
// Fix 300ms delay // Fix 300ms delay
a, button, input, label { a, button, input, label {
touch-action: manipulation; touch-action: manipulation;
} }
}
// Media elements // Media elements
video, video,
@ -138,13 +142,23 @@
// Screen reader only elements // Screen reader only elements
.plyr__sr-only { .plyr__sr-only {
position: absolute !important;
clip: rect(1px, 1px, 1px, 1px); clip: rect(1px, 1px, 1px, 1px);
overflow: hidden;
// !important is not always needed
@if $plyr-sr-only-important == true {
position: absolute !important;
padding: 0 !important; padding: 0 !important;
border: 0 !important; border: 0 !important;
height: 1px !important; height: 1px !important;
width: 1px !important; width: 1px !important;
overflow: hidden; } @else {
position: absolute;
padding: 0;
border: 0;
height: 1px;
width: 1px;
}
} }
// Video // Video

View File

@ -4,6 +4,11 @@
// https://robots.thoughtbot.com/sass-default // https://robots.thoughtbot.com/sass-default
// ========================================================================== // ==========================================================================
// Settings
$plyr-border-box: true !default;
$plyr-touch-action: true !default;
$plyr-sr-only-important: true !default;
// Colors // Colors
$plyr-color-main: #3498db !default; $plyr-color-main: #3498db !default;