Skip to content

Commit

Permalink
Multimedia player: Made volume slider's layout more consistent across…
Browse files Browse the repository at this point in the history
… browsers.

* Adjusted the volume slider's "thumb" (thick vertical line) dimensions, vertical position, inner colour and background colour to look virtually identical across all mainstream browsers. These changes are especially noticeable in Webkit/Blink browsers.
* Prevented Webkit/Blink browsers from defaulting to using a negative outline offset that overlaps the slider track/thumb.
* Moved volume thumb's width and height SCSS variable declarations into the core variables file.
* Added a border SCSS variable for the volume slider's thumb.
  • Loading branch information
EricDunsworth committed Oct 16, 2017
1 parent 69e2931 commit e607726
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/_variables.scss
Expand Up @@ -219,7 +219,10 @@ $mm-ctrl-outline-color: #4aafff !default;
$mm-ctrl-cc-color: #4aafff !default;

$mm-volume-bg-color: #aaa !default;
$mm-volume-thumb-border: 1px solid #707070 !default;
$mm-volume-thumb-color: #fff !default;
$mm-volume-thumb-height: 1.3em !default;
$mm-volume-thumb-width: 10px !default;


//== Tabs
Expand Down
26 changes: 19 additions & 7 deletions src/plugins/multimedia/_base.scss
Expand Up @@ -2,9 +2,6 @@
Multimedia Player Code
*/

$mm-volume-thumb-height: 1.3em;
$mm-volume-thumb-width: 10px;

%multimedia-display-none {
display: none;
}
Expand Down Expand Up @@ -306,13 +303,24 @@ $mm-volume-thumb-width: 10px;
padding: 0;
width: 7em;

&:focus {
/* Prevent Webkit/Blink browsers from defaulting to a -2px outline offset. */
outline-offset: 0;
}

&::-webkit-slider-runnable-track {
background: $mm-volume-bg-color;
height: 4px;
}

&::-webkit-slider-thumb {
margin-top: -8px;
-webkit-appearance: none;
background: $mm-volume-thumb-color;
border: $mm-volume-thumb-border;
box-sizing: content-box;
height: $mm-volume-thumb-height;
margin-top: -9px;
width: $mm-volume-thumb-width;
}

&::-moz-range-track {
Expand All @@ -321,6 +329,8 @@ $mm-volume-thumb-width: 10px;
}

&::-moz-range-thumb {
background: $mm-volume-thumb-color;
border: $mm-volume-thumb-border;
border-radius: 0;
height: $mm-volume-thumb-height;
width: $mm-volume-thumb-width;
Expand All @@ -342,8 +352,9 @@ $mm-volume-thumb-width: 10px;

&::-ms-thumb {
background: $mm-volume-thumb-color;
border: 1px outset #fff;
height: 1.3em;
border: $mm-volume-thumb-border;
height: $mm-volume-thumb-height;
width: $mm-volume-thumb-width;
}
}
}
Expand All @@ -366,7 +377,8 @@ $mm-volume-thumb-width: 10px;

.fd-slider-handle {
background: $mm-volume-thumb-color;
border: 1px outset #fff;
border: $mm-volume-thumb-border;
box-sizing: content-box;
width: $mm-volume-thumb-width;
}
}
Expand Down

0 comments on commit e607726

Please sign in to comment.