Create v6 Slider with Styled System #404
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Next stop on #378.
Slider
didn't require too much updating: the onlystyleOverrides
property being used wasbackgroundColor
, to fix the background of inactive track when the slider is placed over a non-white backround. I just swapped that out with Styled System'sbackgroundColor
/bg
.Also, since the main
Box
component is already receiving all the excess props, I added...Box.propTypes
toSlider
'spropTypes
.Would it be helpful if I restructured the
TrackPart
s so that the blue background gradient stops at the thumb (correctly proportioning the gradient for the new stop point, maybe using Chroma.js) and we just give the inactive part of the trackbg="transparent"
? That way developers wouldn't have to worry about explicitly changing the background color prop when usingSlider
over a non-white background. Or is a white default background there still preferred (or the additional color scale computation too expensive)?