indicate
Version:
Scroll indicator for elements with scrollable overflow.
25 lines (24 loc) • 639 B
JavaScript
// theme/default.ts
var defaultTheme = {
indicator: (_, options, direction) => ({
background: `linear-gradient(to ${direction}, rgba(255, 255, 255, 0), ${options.color})`,
// Initially not visible.
opacity: "0",
display: "flex"
}),
hide: (indicator) => {
indicator.style.opacity = "0";
indicator.style.pointerEvents = "none";
if (!indicator.style.transition) {
indicator.style.transition = "opacity 300ms linear";
}
},
show: (indicator) => {
indicator.style.opacity = "1";
indicator.style.pointerEvents = "auto";
}
};
export {
defaultTheme
};
//# sourceMappingURL=default.js.map