14
14
$_md-sys-motion : tokens .md-sys-motion-values ();
15
15
$_easing-standard : map .get ($_md-sys-motion , ' easing-standard' );
16
16
17
- @mixin styles () {
17
+ @mixin styles ($tokens ) {
18
18
@layer styles {
19
19
.handle-container {
20
20
display : flex ;
@@ -25,7 +25,9 @@ $_easing-standard: map.get($_md-sys-motion, 'easing-standard');
25
25
transition : margin 300ms cubic-bezier (0.175 , 0.885 , 0.32 , 1.275 );
26
26
}
27
27
28
- $margin : calc (var (--_track-width ) - var (--_track-height ));
28
+ $margin : calc (
29
+ map .get ($tokens , ' track-width' ) - map .get ($tokens , ' track-height' )
30
+ );
29
31
30
32
.selected .handle-container {
31
33
margin-inline-start : $margin ;
@@ -41,12 +43,12 @@ $_easing-standard: map.get($_md-sys-motion, 'easing-standard');
41
43
42
44
.handle {
43
45
// Handle shape
44
- border-start-start-radius : var ( --_handle- shape-start-start );
45
- border-start-end-radius : var ( --_handle- shape-start-end );
46
- border-end-end-radius : var ( --_handle- shape-end-end );
47
- border-end-start-radius : var ( --_handle- shape-end-start );
48
- height : var ( --_handle- height );
49
- width : var ( --_handle- width );
46
+ border-start-start-radius : map . get ( $tokens , ' handle- shape-start-start' );
47
+ border-start-end-radius : map . get ( $tokens , ' handle- shape-start-end' );
48
+ border-end-end-radius : map . get ( $tokens , ' handle- shape-end-end' );
49
+ border-end-start-radius : map . get ( $tokens , ' handle- shape-end-start' );
50
+ height : map . get ( $tokens , ' handle- height' );
51
+ width : map . get ( $tokens , ' handle- width' );
50
52
51
53
transform-origin : center ;
52
54
transition-property : height , width ;
@@ -71,90 +73,93 @@ $_easing-standard: map.get($_md-sys-motion, 'easing-standard');
71
73
}
72
74
73
75
.selected .handle {
74
- height : var ( --_selected- handle-height );
75
- width : var ( --_selected- handle-width );
76
+ height : map . get ( $tokens , ' selected- handle-height' );
77
+ width : map . get ( $tokens , ' selected- handle-width' );
76
78
}
77
79
78
80
.handle.with-icon {
79
- height : var ( --_with- icon-handle-height );
80
- width : var ( --_with- icon-handle-width );
81
+ height : map . get ( $tokens , ' with- icon-handle-height' );
82
+ width : map . get ( $tokens , ' with- icon-handle-width' );
81
83
}
82
84
83
85
.selected :not (.disabled ):active .handle ,
84
86
.unselected :not (.disabled ):active .handle {
85
- height : var ( --_pressed- handle-height );
86
- width : var ( --_pressed- handle-width );
87
+ height : map . get ( $tokens , ' pressed- handle-height' );
88
+ width : map . get ( $tokens , ' pressed- handle-width' );
87
89
transition-timing-function : linear ;
88
90
transition-duration : 100ms ;
89
91
}
90
92
91
93
.selected .handle ::before {
92
- background-color : var ( --_selected- handle-color );
94
+ background-color : map . get ( $tokens , ' selected- handle-color' );
93
95
}
94
96
95
97
.selected :hover .handle ::before {
96
- background-color : var ( --_selected- hover-handle-color );
98
+ background-color : map . get ( $tokens , ' selected- hover-handle-color' );
97
99
}
98
100
99
101
.selected :focus-within .handle ::before {
100
- background-color : var ( --_selected- focus-handle-color );
102
+ background-color : map . get ( $tokens , ' selected- focus-handle-color' );
101
103
}
102
104
103
105
.selected :active .handle ::before {
104
- background-color : var ( --_selected- pressed-handle-color );
106
+ background-color : map . get ( $tokens , ' selected- pressed-handle-color' );
105
107
}
106
108
107
109
.selected.disabled .handle ::before {
108
- background-color : var ( --_disabled- selected-handle-color );
109
- opacity : var ( --_disabled- selected-handle-opacity );
110
+ background-color : map . get ( $tokens , ' disabled- selected-handle-color' );
111
+ opacity : map . get ( $tokens , ' disabled- selected-handle-opacity' );
110
112
}
111
113
112
114
.unselected .handle ::before {
113
- background-color : var ( --_handle- color );
115
+ background-color : map . get ( $tokens , ' handle- color' );
114
116
}
115
117
116
118
.unselected :hover .handle ::before {
117
- background-color : var ( --_hover- handle-color );
119
+ background-color : map . get ( $tokens , ' hover- handle-color' );
118
120
}
119
121
120
122
.unselected :focus-within .handle ::before {
121
- background-color : var ( --_focus- handle-color );
123
+ background-color : map . get ( $tokens , ' focus- handle-color' );
122
124
}
123
125
124
126
.unselected :active .handle ::before {
125
- background-color : var ( --_pressed- handle-color );
127
+ background-color : map . get ( $tokens , ' pressed- handle-color' );
126
128
}
127
129
128
130
.unselected.disabled .handle ::before {
129
- background-color : var ( --_disabled- handle-color );
130
- opacity : var ( --_disabled- handle-opacity );
131
+ background-color : map . get ( $tokens , ' disabled- handle-color' );
132
+ opacity : map . get ( $tokens , ' disabled- handle-opacity' );
131
133
}
132
134
133
135
md-ripple {
134
- border-radius : var ( --_state- layer-shape );
135
- height : var ( --_state- layer-size );
136
+ border-radius : map . get ( $tokens , ' state- layer-shape' );
137
+ height : map . get ( $tokens , ' state- layer-size' );
136
138
inset : unset ;
137
- width : var ( --_state- layer-size );
139
+ width : map . get ( $tokens , ' state- layer-size' );
138
140
}
139
141
140
142
.selected md-ripple {
141
143
@include ripple .theme (
142
144
(
143
- ' hover-color' : var (--_selected-hover-state-layer-color ),
144
- ' pressed-color' : var (--_selected-pressed-state-layer-color ),
145
- ' hover-opacity' : var (--_selected-hover-state-layer-opacity ),
146
- ' pressed-opacity' : var (--_selected-pressed-state-layer-opacity ),
145
+ ' hover-color' : map .get ($tokens , ' selected-hover-state-layer-color' ),
146
+ ' pressed-color' :
147
+ map .get ($tokens , ' selected-pressed-state-layer-color' ),
148
+ ' hover-opacity' :
149
+ map .get ($tokens , ' selected-hover-state-layer-opacity' ),
150
+ ' pressed-opacity' :
151
+ map .get ($tokens , ' selected-pressed-state-layer-opacity' ),
147
152
)
148
153
);
149
154
}
150
155
151
156
.unselected md-ripple {
152
157
@include ripple .theme (
153
158
(
154
- ' hover-color' : var ( --_hover- state-layer-color ),
155
- ' pressed-color' : var ( --_pressed- state-layer-color ),
156
- ' hover-opacity' : var ( --_hover- state-layer-opacity ),
157
- ' pressed-opacity' : var ( --_pressed- state-layer-opacity ),
159
+ ' hover-color' : map . get ( $tokens , ' hover- state-layer-color' ),
160
+ ' pressed-color' : map . get ( $tokens , ' pressed- state-layer-color' ),
161
+ ' hover-opacity' : map . get ( $tokens , ' hover- state-layer-opacity' ),
162
+ ' pressed-opacity' : map . get ( $tokens , ' pressed- state-layer-opacity' ),
158
163
)
159
164
);
160
165
}
0 commit comments