|
17 | 17 | /// @param {Color} $base-track-color [null] - The base background color of the track. |
18 | 18 | /// @param {Color} $disabled-base-track-color [null] - The base background color of the track when is disabled. |
19 | 19 | /// |
| 20 | +/// @param {Color} $tick-label-color [null] - The color of the tick label. |
| 21 | +/// @param {Color} $tick-label-color--tall [null] - The color of the tall tick label . |
| 22 | +/// @param {Color} $tick-color [null] - The background-color of the tick. |
| 23 | +/// @param {Color} $tick-color--tall [null] - The background-color of the tall tick. |
| 24 | +/// |
20 | 25 | /// @requires $default-palette |
21 | 26 | /// @requires $light-schema |
22 | 27 | /// @requires apply-palette |
|
44 | 49 | $thumb-disabled-border-color: null, |
45 | 50 | $track-hover-color: null, |
46 | 51 | $thumb-hover-color: null, |
47 | | - $base-track-hover-color: null |
| 52 | + $base-track-hover-color: null, |
| 53 | + $tick-label-color: null, |
| 54 | + $tick-label-color-tall: null, |
| 55 | + $tick-color: null, |
| 56 | + $tick-color-tall: null, |
48 | 57 | ) { |
49 | 58 | $name: 'igx-slider'; |
50 | 59 | $slider-schema: (); |
|
75 | 84 | disabled-base-track-color: $disabled-base-track-color, |
76 | 85 | thumb-border-color: $thumb-border-color, |
77 | 86 | thumb-disabled-border-color: $thumb-disabled-border-color, |
78 | | - base-track-hover-color: $base-track-hover-color |
| 87 | + base-track-hover-color: $base-track-hover-color, |
| 88 | + tick-label-color: $tick-label-color, |
| 89 | + tick-label-color-tall: $tick-label-color-tall, |
| 90 | + tick-color: $tick-color, |
| 91 | + tick-color-tall: $tick-color-tall, |
79 | 92 | )); |
80 | 93 | } |
81 | 94 |
|
|
96 | 109 | fluent: 4px |
97 | 110 | ), map-get($theme, variant)); |
98 | 111 |
|
| 112 | + // Slide ticks |
| 113 | + $tick-push: rem(4px); |
| 114 | + $base-tick-height: rem(8px); |
| 115 | + $tick-height: $base-tick-height; |
| 116 | + $tick-height--tall: $base-tick-height * 2; |
| 117 | + $tick-width: rem(2px); |
| 118 | + |
99 | 119 | $thumb-border-width: map-get(( |
100 | 120 | material: 0, |
101 | 121 | fluent: 2px |
|
165 | 185 | height: 0; |
166 | 186 | cursor: default; |
167 | 187 | z-index: 1; |
| 188 | + left: 0; |
168 | 189 | } |
169 | 190 |
|
170 | 191 | %igx-slider-track { |
171 | | - position: absolute; |
| 192 | + position: relative; |
172 | 193 | width: 100%; |
173 | 194 | height: rem($slider-track-height); |
174 | 195 | background: --var($theme, 'base-track-color'); |
|
179 | 200 | background: --var($theme, 'disabled-base-track-color'); |
180 | 201 | } |
181 | 202 |
|
182 | | - %igx-slider-track-ticks { |
| 203 | + %igx-slider-track-fill { |
| 204 | + position: absolute; |
| 205 | + width: 100%; |
| 206 | + height: inherit; |
| 207 | + background: --var($theme, 'track-color'); |
| 208 | + transform-origin: #{$left} center; |
| 209 | + transform: scaleX(0); |
| 210 | + } |
| 211 | + |
| 212 | + %igx-slider-track-fill--disabled { |
| 213 | + visibility: hidden; |
| 214 | + } |
| 215 | + |
| 216 | + %igx-slider__ticks { |
| 217 | + width: 100%; |
| 218 | + display: flex; |
| 219 | + position: absolute; |
| 220 | + top: $tick-push; |
| 221 | + justify-content: space-between; |
| 222 | + z-index: 1; |
| 223 | + |
| 224 | + &%igx-slider__ticks--top { |
| 225 | + bottom: $tick-push; |
| 226 | + top: auto; |
| 227 | + align-items: flex-end; |
| 228 | + } |
| 229 | + } |
| 230 | + |
| 231 | + %igx-slider__ticks-group { |
| 232 | + display: flex; |
| 233 | + flex-direction: column; |
| 234 | + align-items: center; |
| 235 | + position: relative; |
| 236 | + |
| 237 | + &:first-of-type { |
| 238 | + margin-left: rem(-1px); |
| 239 | + } |
| 240 | + |
| 241 | + &:last-of-type { |
| 242 | + margin-left: rem(-1px); |
| 243 | + } |
| 244 | + } |
| 245 | + |
| 246 | + %igx-slider__ticks-label { |
| 247 | + color: --var($theme, 'tick-label-color'); |
| 248 | + position: absolute; |
| 249 | + top: $tick-height--tall; |
| 250 | + transform: translate(-50%); |
| 251 | + line-height: .7; |
| 252 | + opacity: 1; |
| 253 | + transition: opacity .2s $ease-in-out-quad; |
| 254 | + } |
| 255 | + |
| 256 | + %igx-slider__ticks-tick { |
| 257 | + background: --var($theme, 'tick-color'); |
| 258 | + height: $tick-height; |
| 259 | + width: $tick-width; |
| 260 | + } |
| 261 | + |
| 262 | + %igx-slider__ticks--tall { |
| 263 | + %igx-slider__ticks-label { |
| 264 | + top: calc(#{$tick-height--tall} + #{$tick-height}); |
| 265 | + } |
| 266 | + } |
| 267 | + |
| 268 | + %igx-slider__tick--disabled { |
| 269 | + background: --var($theme, 'disabled-base-track-color')!important; |
| 270 | + } |
| 271 | + |
| 272 | + %igx-slider__ticks-labels--disabled { |
| 273 | + color: --var($theme, 'disabled-base-track-color')!important; |
| 274 | + } |
| 275 | + |
| 276 | + %igx-slider__ticks-group--tall { |
| 277 | + %igx-slider__ticks-tick { |
| 278 | + height: $tick-height--tall; |
| 279 | + background: --var($theme, 'tick-color-tall'); |
| 280 | + } |
| 281 | + |
| 282 | + %igx-slider__ticks-label { |
| 283 | + top: calc(#{$tick-height--tall} + #{$tick-height}); |
| 284 | + color: --var($theme, 'tick-label-color-tall'); |
| 285 | + } |
| 286 | + } |
| 287 | + |
| 288 | + %igx-slider__ticks--top { |
| 289 | + %igx-slider__ticks-label { |
| 290 | + bottom: calc(#{$tick-height} + #{$tick-height}); |
| 291 | + top: auto; |
| 292 | + } |
| 293 | + |
| 294 | + &%igx-slider__ticks--tall { |
| 295 | + %igx-slider__ticks-label { |
| 296 | + bottom: calc(#{$tick-height--tall} + #{$tick-height}); |
| 297 | + top: auto; |
| 298 | + } |
| 299 | + } |
| 300 | + } |
| 301 | + |
| 302 | + %igx-slider__tick-label--hidden { |
| 303 | + opacity: 0; |
| 304 | + } |
| 305 | + |
| 306 | + %igx-slider-track-steps { |
183 | 307 | position: absolute; |
184 | 308 | width: 100%; |
185 | 309 | height: rem($slider-track-height); |
|
189 | 313 | z-index: 1; |
190 | 314 | } |
191 | 315 |
|
192 | | - %igx-slider-track-ticks--disabled { |
| 316 | + %igx-slider-track-steps--disabled { |
193 | 317 | visibility: hidden; |
194 | 318 | } |
195 | 319 |
|
196 | | - %igx-slider-track-fill { |
197 | | - position: absolute; |
198 | | - width: 100%; |
199 | | - height: inherit; |
200 | | - background: --var($theme, 'track-color'); |
201 | | - transform-origin: #{$left} center; |
202 | | - transform: scaleX(0); |
| 320 | + %igx-slider__tick-labels--top-bottom { |
| 321 | + %igx-slider__ticks-group { |
| 322 | + display: block; |
| 323 | + } |
| 324 | + |
| 325 | + %igx-slider__ticks-label { |
| 326 | + writing-mode: vertical-rl; |
| 327 | + transform: translate(-50%) rotate(0deg); |
| 328 | + } |
| 329 | + |
| 330 | + %igx-slider__ticks--tall { |
| 331 | + %igx-slider__ticks-label { |
| 332 | + top: calc(#{$tick-height--tall} + #{rem(2px)}); |
| 333 | + } |
| 334 | + } |
| 335 | + |
| 336 | + &%igx-slider__ticks--top { |
| 337 | + %igx-slider__ticks-label { |
| 338 | + writing-mode: vertical-rl; |
| 339 | + transform: translate(-50%) rotate(0deg); |
| 340 | + } |
| 341 | + |
| 342 | + %igx-slider__ticks--tall { |
| 343 | + %igx-slider__ticks-label { |
| 344 | + bottom: calc(#{$tick-height--tall} + #{rem(2px)}); |
| 345 | + } |
| 346 | + } |
| 347 | + } |
203 | 348 | } |
204 | 349 |
|
205 | | - %igx-slider-track-fill--disabled { |
206 | | - visibility: hidden; |
| 350 | + %igx-slider__tick-labels--bottom-top { |
| 351 | + %igx-slider__ticks-group { |
| 352 | + display: block; |
| 353 | + } |
| 354 | + |
| 355 | + |
| 356 | + %igx-slider__ticks-label { |
| 357 | + writing-mode: vertical-rl; |
| 358 | + transform: translate(-50%) rotate(180deg); |
| 359 | + } |
| 360 | + |
| 361 | + &%igx-slider__ticks--top { |
| 362 | + %igx-slider__ticks-label { |
| 363 | + writing-mode: vertical-rl; |
| 364 | + transform: translate(-50%) rotate(180deg); |
| 365 | + } |
| 366 | + |
| 367 | + %igx-slider__ticks--tall { |
| 368 | + %igx-slider__ticks-label { |
| 369 | + bottom: calc(#{$tick-height--tall} + #{rem(2px)}); |
| 370 | + } |
| 371 | + } |
| 372 | + } |
207 | 373 | } |
208 | 374 |
|
209 | 375 | %igx-thumb-display { |
|
0 commit comments