vue-snap
Version:
Lightweight Carousel based on CSS Scroll Snap
55 lines (47 loc) • 917 B
CSS
.vs-carousel {
position: relative;
}
.vs-carousel__wrapper {
display: flex;
overflow-x: scroll;
overflow-y: hidden;
scroll-snap-type: x mandatory;
scroll-behavior: smooth;
scrollbar-width: none;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: none;
list-style: none;
margin: 0;
padding: 0;
}
.vs-carousel__wrapper::-webkit-scrollbar {
display: none;
}
.vs-carousel__slide {
flex: 0 0 100%;
height: 100%;
scroll-snap-align: start;
display: flex;
justify-content: center;
align-items: center;
outline: none;
}
.vs-carousel__arrows {
position: absolute;
top: 0;
bottom: 0;
margin: auto;
width: 48px;
height: 48px;
padding: 0;
cursor: pointer;
}
.vs-carousel__arrows:disabled {
cursor: not-allowed;
}
.vs-carousel__arrows--left {
left: 0;
}
.vs-carousel__arrows--right {
right: 0;
}