1
1
@import ' default-theme' ;
2
+ @import ' _variables' ;
2
3
3
4
// This refers to the thickness of the slider. On a horizontal slider this is the height, on a
4
5
// 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 ;
7
9
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 ;
10
12
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 ;
13
15
14
16
// 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 );
18
20
19
21
/* *
20
22
* 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);
26
28
/* *
27
29
* Positions the thumb based on its width and height.
28
30
*/
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 ) {
30
32
position : absolute ;
31
- top : center-vertically ($slider-thickness , $height );
33
+ top : center-vertically ($md- slider-thickness , $height );
32
34
width : $width ;
33
35
height : $height ;
34
36
border-radius : max ($width , $height );
35
37
}
36
38
37
39
md-slider {
38
- height : $slider-thickness ;
39
- min-width : $slider-min-size ;
40
+ height : $md- slider-thickness ;
41
+ min-width : $md- slider-min-size ;
40
42
position : relative ;
41
43
padding : 0 ;
42
44
display : inline-block ;
@@ -56,12 +58,12 @@ md-slider *::after {
56
58
.md-slider-wrapper {
57
59
width : 100% ;
58
60
height : 100% ;
59
- padding-left : 8 px ;
60
- padding-right : 8 px ;
61
+ padding-left : $md-slider-padding ;
62
+ padding-right : $md-slider-padding ;
61
63
}
62
64
63
65
/* *
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.
65
67
* Cannot be merged with .md-slider-wrapper.
66
68
*/
67
69
.md-slider-container {
@@ -71,21 +73,21 @@ md-slider *::after {
71
73
.md-slider-track-container {
72
74
width : 100% ;
73
75
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 ;
76
78
}
77
79
78
80
.md-slider-track {
79
81
position : absolute ;
80
82
left : 0 ;
81
83
right : 0 ;
82
84
height : 100% ;
83
- background-color : $slider-off-color ;
85
+ background-color : $md- slider-off-color ;
84
86
}
85
87
86
88
.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 ;
89
91
transition-property : width , height ;
90
92
background-color : md-color ($md-accent );
91
93
}
@@ -95,29 +97,29 @@ md-slider *::after {
95
97
left : 0 ;
96
98
top : 50% ;
97
99
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 ;
100
102
transition-property : left , bottom ;
101
103
}
102
104
103
105
.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 ;
105
107
}
106
108
107
109
.md-slider-thumb {
108
110
z-index : 1 ;
109
111
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 ;
113
115
}
114
116
115
117
.md-slider-thumb ::after {
116
118
content : ' ' ;
117
119
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 );
121
123
border-width : 3px ;
122
124
border-style : solid ;
123
125
transition : inherit ;
@@ -132,10 +134,10 @@ md-slider *::after {
132
134
}
133
135
134
136
.md-slider-active .md-slider-thumb {
135
- transform : scale ($slider-thumb-focus-scale );
137
+ transform : scale ($md- slider-thumb-focus-scale );
136
138
}
137
139
138
140
.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 ;
141
143
}
0 commit comments