11@import ' default-theme' ;
2+ @import ' _variables' ;
23
34// This refers to the thickness of the slider. On a horizontal slider this is the height, on a
45// vertical slider this is the width.
5- $slider-thickness : 20px !default ;
6- $slider-min-size : 128px !default ;
6+ $md-slider-thickness : 20px !default ;
7+ $md-slider-min-size : 128px !default ;
8+ $md-slider-padding : 8px !default ;
79
8- $slider-track-height : 2px !default ;
9- $slider-thumb-size : 20px !default ;
10+ $md- slider-track-height : 2px !default ;
11+ $md- slider-thumb-size : 20px !default ;
1012
11- $slider-thumb-default-scale : 0.7 !default ;
12- $slider-thumb-focus-scale : 1 !default ;
13+ $md- slider-thumb-default-scale : 0.7 !default ;
14+ $md- slider-thumb-focus-scale : 1 !default ;
1315
1416// TODO(iveysaur): Find an implementation to hide the track under a disabled thumb.
15- $slider-off-color : rgba (black , 0.26 );
16- $slider-focused-color : rgba (black , 0.38 );
17- $slider-disabled-color : rgba (black , 0.26 );
17+ $md- slider-off-color : rgba (black , 0.26 );
18+ $md- slider-focused-color : rgba (black , 0.38 );
19+ $md- slider-disabled-color : rgba (black , 0.26 );
1820
1921/* *
2022 * Uses a container height and an item height to center an item vertically within the container.
@@ -26,17 +28,17 @@ $slider-disabled-color: rgba(black, 0.26);
2628/* *
2729 * Positions the thumb based on its width and height.
2830 */
29- @mixin slider-thumb-position ($width : $slider-thumb-size , $height : $slider-thumb-size ) {
31+ @mixin slider-thumb-position ($width : $md- slider-thumb-size , $height : $md- slider-thumb-size ) {
3032 position : absolute ;
31- top : center-vertically ($slider-thickness , $height );
33+ top : center-vertically ($md- slider-thickness , $height );
3234 width : $width ;
3335 height : $height ;
3436 border-radius : max ($width , $height );
3537}
3638
3739md-slider {
38- height : $slider-thickness ;
39- min-width : $slider-min-size ;
40+ height : $md- slider-thickness ;
41+ min-width : $md- slider-min-size ;
4042 position : relative ;
4143 padding : 0 ;
4244 display : inline-block ;
@@ -56,12 +58,12 @@ md-slider *::after {
5658.md-slider-wrapper {
5759 width : 100% ;
5860 height : 100% ;
59- padding-left : 8 px ;
60- padding-right : 8 px ;
61+ padding-left : $md-slider-padding ;
62+ padding-right : $md-slider-padding ;
6163}
6264
6365/* *
64- * Holds the isActive and isDragging classes as well as help with positioning the children.
66+ * Holds the isActive and isDragging classes as well as helps with positioning the children.
6567 * Cannot be merged with .md-slider-wrapper.
6668 */
6769.md-slider-container {
@@ -71,21 +73,21 @@ md-slider *::after {
7173.md-slider-track-container {
7274 width : 100% ;
7375 position : absolute ;
74- top : center-vertically ($slider-thickness , $slider-track-height );
75- height : $slider-track-height ;
76+ top : center-vertically ($md- slider-thickness , $md- slider-track-height );
77+ height : $md- slider-track-height ;
7678}
7779
7880.md-slider-track {
7981 position : absolute ;
8082 left : 0 ;
8183 right : 0 ;
8284 height : 100% ;
83- background-color : $slider-off-color ;
85+ background-color : $md- slider-off-color ;
8486}
8587
8688.md-slider-track-fill {
87- transition-duration : 400 ms ;
88- transition-timing-function : cubic-bezier ( 0.25 , 0.8 , 0.25 , 1 ) ;
89+ transition-duration : $swift-ease-out-duration ;
90+ transition-timing-function : $swift-ease-out-timing-function ;
8991 transition-property : width , height ;
9092 background-color : md-color ($md-accent );
9193}
@@ -95,29 +97,29 @@ md-slider *::after {
9597 left : 0 ;
9698 top : 50% ;
9799 transform : translate3d (-50% , -50% , 0 );
98- transition-duration : 400 ms ;
99- transition-timing-function : cubic-bezier ( 0.25 , 0.8 , 0.25 , 1 ) ;
100+ transition-duration : $swift-ease-out-duration ;
101+ transition-timing-function : $swift-ease-out-timing-function ;
100102 transition-property : left , bottom ;
101103}
102104
103105.md-slider-thumb-position {
104- transition : transform 400 ms cubic-bezier ( 0.25 , 0.8 , 0.25 , 1 ) ;
106+ transition : transform $swift-ease-out-duration $swift-ease-out-timing-function ;
105107}
106108
107109.md-slider-thumb {
108110 z-index : 1 ;
109111
110- @include slider-thumb-position ($slider-thumb-size , $slider-thumb-size );
111- transform : scale ($slider-thumb-default-scale );
112- transition : transform 400 ms cubic-bezier ( 0.25 , 0.8 , 0.25 , 1 ) ;
112+ @include slider-thumb-position ($md- slider-thumb-size , $md- slider-thumb-size );
113+ transform : scale ($md- slider-thumb-default-scale );
114+ transition : transform $swift-ease-out-duration $swift-ease-out-timing-function ;
113115}
114116
115117.md-slider-thumb ::after {
116118 content : ' ' ;
117119 position : absolute ;
118- width : $slider-thumb-size ;
119- height : $slider-thumb-size ;
120- border-radius : max ($slider-thumb-size , $slider-thumb-size );
120+ width : $md- slider-thumb-size ;
121+ height : $md- slider-thumb-size ;
122+ border-radius : max ($md- slider-thumb-size , $md- slider-thumb-size );
121123 border-width : 3px ;
122124 border-style : solid ;
123125 transition : inherit ;
@@ -132,10 +134,10 @@ md-slider *::after {
132134}
133135
134136.md-slider-active .md-slider-thumb {
135- transform : scale ($slider-thumb-focus-scale );
137+ transform : scale ($md- slider-thumb-focus-scale );
136138}
137139
138140.md-slider-disabled .md-slider-thumb ::after {
139- background-color : $slider-disabled-color ;
140- border-color : $slider-disabled-color ;
141+ background-color : $md- slider-disabled-color ;
142+ border-color : $md- slider-disabled-color ;
141143}
0 commit comments