react-product-glider
Version:
A customizable responsive product slider for React
90 lines (78 loc) • 1.41 kB
CSS
.product-slider {
position: relative;
width: 100%;
height: auto;
overflow: hidden;
}
.slider-window {
overflow: hidden;
width: 100%;
}
.slider-track {
display: flex;
width: 100%;
}
.slide {
flex-shrink: 0;
flex-grow: 0;
box-sizing: border-box;
padding: 10px;
width: 100%; /* Will be overridden inline based on slidesToShow */
}
.arrow {
position: absolute;
top: 50%;
font-size: 2rem;
color: #333;
border: none;
border-radius: 50%;
width: 50px;
height: 50px;
background-color: #fff;
cursor: pointer;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
border: 1px solid #ccc;
}
.arrow.left {
left: 10px;
}
.arrow.right {
right: 10px;
}
.dots {
display: flex;
justify-content: center;
margin-top: 10px;
}
.dot {
width: 12px;
height: 12px;
background: gray;
margin: 0 4px;
border-radius: 50%;
cursor: pointer;
}
.dot.active {
background: blueviolet;
}
.product-card {
width: 100%;
height:300px;
background-color: #fff;
color: white;
border-radius: 4px;
padding: 10px;
box-shadow: rgba(0,0,0,0.045) 3px 3px 15px 0px;
border: 1px solid #f7f7f7;
position: relative;
}
.product-card img {
width: 100%;
height: 50pxs;
object-fit: cover;
border-radius: 4px;
}