@@ -12,6 +12,7 @@ const Z_INDEX = {
12
12
} ;
13
13
14
14
const THUMB_SIZE = 18 ;
15
+ const TRACK_HEIGHT = 3 ;
15
16
const TRACK_PADDING = 12 ;
16
17
const STEP_MIN_WIDTH = 24 ;
17
18
@@ -642,7 +643,7 @@ export class UUIRangeSliderElement extends UUIFormControlMixin(LitElement, '') {
642
643
643
644
return html `<div class= "step-wrapper" >
644
645
<svg height= "100%" width = "100%">
645
- <rect x= "9" y = "9" height= "3 " rx= "2" / >
646
+ <rect x= "9" y = "9" height= "${ TRACK_HEIGHT } " rx= "2" / >
646
647
${ this . _renderStepCircles ( stepPositions ) }
647
648
</ svg>
648
649
${ this . _renderStepValues ( stepAmount ) }
@@ -671,9 +672,9 @@ export class UUIRangeSliderElement extends UUIFormControlMixin(LitElement, '') {
671
672
const colorEnd = this . _highInputValue - this . _min ;
672
673
673
674
if ( cx / trackValue >= colorStart && cx / trackValue <= colorEnd ) {
674
- return svg `<circle class= "track-step filled" cx = "${ cx } " cy= "5 " r= "4.5" / > ` ;
675
+ return svg `<circle class= "track-step filled" cx = "${ cx } " cy= "${ TRACK_HEIGHT * 2 } " r= "4.5" / > ` ;
675
676
} else {
676
- return svg `<circle class= "track-step regular" cx = "${ cx } " cy= "5 " r= "4.5" / > ` ;
677
+ return svg `<circle class= "track-step regular" cx = "${ cx } " cy= "${ TRACK_HEIGHT * 2 } " r= "4.5" / > ` ;
677
678
}
678
679
} ) } `;
679
680
}
@@ -779,16 +780,18 @@ export class UUIRangeSliderElement extends UUIFormControlMixin(LitElement, '') {
779
780
}
780
781
781
782
: host (: not ([readonly ])) # inner-color-thumb : hover .color {
782
- height : 5 px ;
783
+ height : ${ TRACK_HEIGHT * 2 } px ;
783
784
background-color : var (--color-hover );
785
+ transform : translateY (-${ TRACK_HEIGHT / 2 } px);
784
786
}
785
787
786
788
.color {
787
789
user-select : none;
788
790
position : absolute;
789
791
inset-inline : 0 ;
790
- height : 3px ;
791
- transform : translateY (2px );
792
+ height : ${ TRACK_HEIGHT } px;
793
+ top : 50% ;
794
+ transform : translateY (0 );
792
795
background-color : var (--color-interactive );
793
796
transition : height 60ms ;
794
797
}
0 commit comments