feat(carousel): implement product carousel component with mock data and styles

This commit is contained in:
2026-07-23 11:47:10 -03:00
parent 20c8b04638
commit 3e98d08d59
8 changed files with 542 additions and 61 deletions

View File

@@ -0,0 +1,75 @@
:host {
display: block;
min-width: 0;
}
.carousel {
position: relative;
width: 100%;
&__viewport {
display: flex;
width: 100%;
overflow-x: auto;
overscroll-behavior-inline: contain;
scroll-behavior: smooth;
scroll-snap-type: inline mandatory;
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
&:focus-visible {
outline: 2px solid var(--color-primary, currentColor);
outline-offset: 2px;
}
}
&__item {
flex: 0 0 auto;
min-width: 0;
scroll-snap-align: start;
}
&__control {
position: absolute;
top: 50%;
display: grid;
width: 2.25rem;
height: 2.25rem;
padding: 0;
color: #fff;
cursor: pointer;
background: rgb(0 0 0 / 55%);
border: 0;
border-radius: 50%;
place-items: center;
transform: translateY(-50%);
&:disabled {
cursor: default;
opacity: 0;
pointer-events: none;
}
&:focus-visible {
outline: 2px solid var(--color-primary, currentColor);
outline-offset: 2px;
}
&--previous {
left: 0.5rem;
}
&--next {
right: 0.5rem;
}
}
}
@media (prefers-reduced-motion: reduce) {
.carousel__viewport {
scroll-behavior: auto;
}
}