Skip to content

Commit

Permalink
fix(RangeSlider): Fix rail positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
m7kvqbe1 committed Nov 2, 2020
1 parent a50a339 commit 2a89fac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
20 changes: 8 additions & 12 deletions packages/css-framework/src/components/_range-slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ $range-slider-above-thresholds: f.color("action", "500");
> div {
position: relative;
width: 100%;
height: 38px;
height: 40px;
padding-top: 20px;
}

&.is-disabled {
Expand All @@ -43,26 +44,21 @@ $range-slider-above-thresholds: f.color("action", "500");
}

.rn-rangeslider__rail {
position: relative;
display: inline-block;
width: 100%;
height: 2px;
top: 0.3rem;
}

.rn-rangeslider__rail-outer {
position: absolute;
top: calc(50% + 20px);
left: 0;
display: inline-block;
width: 100%;
height: 40px;
transform: translate(0%, -50%);
cursor: pointer;
transform: translateY(-100%);
}

.rn-rangeslider__rail-inner {
position: absolute;
top: 50%;
width: 100%;
height: 2px;
transform: translate(0%, -50%);
transform: translateY(-50%);
background-color: $range-slider-bg-colour;
pointer-events: none;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ export const RangeSlider: React.FC<RangeSliderProps> = ({
<Rail>
{({ getRailProps }) => (
<div className="rn-rangeslider__rail">
<div className="rn-rangeslider__rail-outer" {...getRailProps()} />
<div className="rn-rangeslider__rail-inner" />
<div className="rn-rangeslider__rail-inner" {...getRailProps()} />
</div>
)}
</Rail>
Expand Down

0 comments on commit 2a89fac

Please sign in to comment.