@@ -55,6 +55,89 @@ $_track-inactive-height: 4px;
55
55
// ripple-related styles from the other slider styles.
56
56
// It is recommended that most users use `core-styles` instead.
57
57
@mixin without-ripple ($query : feature-targeting .all ()) {
58
+ $feat-color : feature-targeting .create-target ($query , color );
59
+
60
+ @include static-styles ($query : $query );
61
+
62
+ .mdc-slider {
63
+ @include slider-theme .track-active-color (
64
+ $color-or-map : (
65
+ default : slider-theme .$color ,
66
+ disabled : slider-theme .$disabled-color ,
67
+ ),
68
+ $query : $query
69
+ );
70
+
71
+ @include slider-theme .track-inactive-color (
72
+ $color-or-map : (
73
+ default : slider-theme .$color ,
74
+ disabled : slider-theme .$disabled-color ,
75
+ ),
76
+ $query : $query
77
+ );
78
+
79
+ @include slider-theme .thumb-color (
80
+ $color-or-map : (
81
+ default : slider-theme .$color ,
82
+ disabled : slider-theme .$disabled-color ,
83
+ ),
84
+ $query : $query
85
+ );
86
+
87
+ @include slider-theme .thumb-ripple-color (
88
+ $color : slider-theme .$color ,
89
+ $query : $query
90
+ );
91
+
92
+ @include slider-theme .tick-mark-active-color (
93
+ $color-or-map : (
94
+ default : slider-theme .$tick-mark-active-color ,
95
+ disabled : on- primary,
96
+ ),
97
+ $query : $query
98
+ );
99
+
100
+ @include slider-theme .tick-mark-inactive-color (
101
+ $color-or-map : (
102
+ default : slider-theme .$tick-mark-inactive-color ,
103
+ disabled : slider-theme .$disabled-color ,
104
+ ),
105
+ $query : $query
106
+ );
107
+
108
+ @include slider-theme .value-indicator-color (
109
+ $color : slider-theme .$value-indicator-color ,
110
+ $opacity : slider-theme .$value-indicator-opacity ,
111
+ $query : $query
112
+ );
113
+
114
+ @include slider-theme .value-indicator-text-color (
115
+ $color : slider-theme .$value-indicator-text-color ,
116
+ $query : $query
117
+ );
118
+ }
119
+
120
+ .mdc-slider--disabled {
121
+ @include feature-targeting .targets ($feat-color ) {
122
+ opacity : 0.38 ;
123
+ }
124
+ }
125
+ }
126
+
127
+ // This API is intended for use by frameworks that may want to separate the
128
+ // ripple-related styles from the other slider styles.
129
+ // It is recommended that most users use `core-styles` instead.
130
+ @mixin ripple ($query : feature-targeting .all ()) {
131
+ @include ripple .common ($query ); // COPYBARA_COMMENT_THIS_LINE
132
+
133
+ .mdc-slider__thumb {
134
+ @include ripple .surface ($query : $query );
135
+ @include ripple .radius-unbounded ($query : $query );
136
+ @include ripple-theme .states ($color : slider-theme .$color , $query : $query );
137
+ }
138
+ }
139
+
140
+ @mixin static-styles ($query : feature-targeting .all ()) {
58
141
$feat-animation : feature-targeting .create-target ($query , animation );
59
142
$feat-color : feature-targeting .create-target ($query , color );
60
143
$feat-structure : feature-targeting .create-target ($query , structure );
@@ -110,19 +193,6 @@ $_track-inactive-height: 4px;
110
193
}
111
194
}
112
195
113
- // This API is intended for use by frameworks that may want to separate the
114
- // ripple-related styles from the other slider styles.
115
- // It is recommended that most users use `core-styles` instead.
116
- @mixin ripple ($query : feature-targeting .all ()) {
117
- @include ripple .common ($query ); // COPYBARA_COMMENT_THIS_LINE
118
-
119
- .mdc-slider__thumb {
120
- @include ripple .surface ($query : $query );
121
- @include ripple .radius-unbounded ($query : $query );
122
- @include ripple-theme .states ($color : slider-theme .$color , $query : $query );
123
- }
124
- }
125
-
126
196
@mixin _track ($query : feature-targeting .all ()) {
127
197
$feat-structure : feature-targeting .create-target ($query , structure );
128
198
@@ -153,6 +223,7 @@ $_track-inactive-height: 4px;
153
223
// such that the track grows/shrinks as needed, but the border-radius
154
224
// is not affected by the scaling.
155
225
border-radius : 3px ;
226
+ // TODO(b/241274018): not static, move into themeable styles
156
227
height : $_track-active-height ;
157
228
overflow : hidden ;
158
229
top : math .div ($_track-inactive-height - $_track-active-height , 2 );
@@ -193,21 +264,6 @@ $_track-inactive-height: 4px;
193
264
top : 0 ;
194
265
}
195
266
}
196
-
197
- @include slider-theme .track-active-color (
198
- $color-or-map : (
199
- default : slider-theme .$color ,
200
- disabled : slider-theme .$disabled-color ,
201
- ),
202
- $query : $query
203
- );
204
- @include slider-theme .track-inactive-color (
205
- $color-or-map : (
206
- default : slider-theme .$color ,
207
- disabled : slider-theme .$disabled-color ,
208
- ),
209
- $query : $query
210
- );
211
267
}
212
268
213
269
@mixin _thumb ($query : feature-targeting .all ()) {
@@ -219,6 +275,7 @@ $_track-inactive-height: 4px;
219
275
.mdc-slider__thumb {
220
276
@include feature-targeting .targets ($feat-structure ) {
221
277
display : flex ;
278
+ // TODO(b/241274018): not static, move (+ width) to themeable styles
222
279
height : $_thumb-ripple-size ;
223
280
@include rtl .ignore-next-line ();
224
281
left : math .div (- $_thumb-ripple-size , 2 );
@@ -262,18 +319,6 @@ $_track-inactive-height: 4px;
262
319
width : $_thumb-size ;
263
320
}
264
321
}
265
-
266
- @include slider-theme .thumb-color (
267
- $color-or-map : (
268
- default : slider-theme .$color ,
269
- disabled : slider-theme .$disabled-color ,
270
- ),
271
- $query : $query
272
- );
273
- @include slider-theme .thumb-ripple-color (
274
- $color : slider-theme .$color ,
275
- $query : $query
276
- );
277
322
}
278
323
279
324
@mixin _tick-marks ($query : feature-targeting .all ()) {
@@ -297,25 +342,11 @@ $_track-inactive-height: 4px;
297
342
.mdc-slider__tick-mark--inactive {
298
343
@include feature-targeting .targets ($feat-structure ) {
299
344
border-radius : 50% ;
345
+ // TODO(b/241274018): not static, move (+ width) to themeable styles
300
346
height : 2px ;
301
347
width : 2px ;
302
348
}
303
349
}
304
-
305
- @include slider-theme .tick-mark-active-color (
306
- $color-or-map : (
307
- default : slider-theme .$tick-mark-active-color ,
308
- disabled : on- primary,
309
- ),
310
- $query : $query
311
- );
312
- @include slider-theme .tick-mark-inactive-color (
313
- $color-or-map : (
314
- default : slider-theme .$tick-mark-inactive-color ,
315
- disabled : slider-theme .$disabled-color ,
316
- ),
317
- $query : $query
318
- );
319
350
}
320
351
321
352
@mixin _value-indicator ($query : feature-targeting .all ()) {
@@ -427,27 +458,12 @@ $_track-inactive-height: 4px;
427
458
.mdc-slider__value-indicator-text {
428
459
@include typography .typography (subtitle2, $query );
429
460
}
430
-
431
- @include slider-theme .value-indicator-color (
432
- $color : slider-theme .$value-indicator-color ,
433
- $opacity : slider-theme .$value-indicator-opacity ,
434
- $query : $query
435
- );
436
- @include slider-theme .value-indicator-text-color (
437
- $color : slider-theme .$value-indicator-text-color ,
438
- $query : $query
439
- );
440
461
}
441
462
442
463
// Styles for slider in disabled state.
443
464
@mixin _disabled ($query : feature-targeting .all ()) {
444
- $feat-color : feature-targeting .create-target ($query , color );
445
465
$feat-structure : feature-targeting .create-target ($query , structure );
446
466
447
- @include feature-targeting .targets ($feat-color ) {
448
- opacity : 0.38 ;
449
- }
450
-
451
467
@include feature-targeting .targets ($feat-structure ) {
452
468
cursor : auto ;
453
469
}
0 commit comments