Created
July 2, 2020 11:18
-
-
Save colmtuite/4762ed9125a2f7904a36b00c252b73a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { sliderprimitive } from "@modulz/primitives"; | |
const Slider = sliderprimitive(); | |
const { Thumb, InnerTrack, Track } = Slider; | |
Slider.style({ | |
[Track]: { | |
borderRadius: "3px", | |
backgroundColor: "gainsboro", | |
}, | |
[Thumb]: { | |
width: "10px", | |
height: "10px", | |
border: "none", | |
borderRadius: "15px", | |
"::after": { | |
content: '""', | |
position: "absolute", | |
borderRadius: "15px", | |
width: "100%", | |
height: "100%", | |
boxShadow: "0 5px 15px #000", | |
opacity: "0", | |
} | |
}, | |
":hover": { | |
[Thumb]: { | |
"::after": { | |
opacity: "1" | |
} | |
} | |
} | |
}); | |
Slider.variant("size", { | |
normal: { | |
[Thumb]: { | |
width: "15px", | |
height: "15px" | |
} | |
}, | |
large: { | |
[Thumb]: { | |
width: "25px", | |
height: "25px" | |
} | |
} | |
}); | |
Slider.variant("color", { | |
red: { | |
[Thumb]: { | |
background: "tomato" | |
}, | |
[InnerTrack]: { | |
background: "red" | |
} | |
}, | |
blue: { | |
[Thumb]: { | |
background: "blue" | |
}, | |
[InnerTrack]: { | |
background: "cyan" | |
} | |
} | |
}); | |
export const Slider = Slider.bake(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment