@ebay/skin
Version:
Skin - CSS modules that represent the brand eBay
312 lines (300 loc) • 7.64 kB
CSS
.carousel {
position: relative;
}
.carousel__container {
position: relative;
white-space: nowrap;
width: 100%;
}
.carousel__container--controls-disabled .carousel__control.carousel__control {
display: none;
}
.carousel__list {
display: flex;
margin: 0;
padding: 0;
position: relative;
transition: transform 0.45s ease-in-out;
width: 100%;
}
.carousel__list > li {
display: inline-block;
flex-shrink: 0;
list-style: none;
}
.carousel__playback {
background-color: rgba(0, 0, 0, 0.45);
border: 0;
border-radius: 50%;
bottom: 16px;
box-sizing: border-box;
color: var(
--carousel-playback-foreground-color,
var(--color-foreground-on-inverse)
);
height: 40px;
margin-bottom: 19px;
margin-right: 19px;
padding: 0;
position: absolute;
right: 0;
text-align: center;
width: 40px;
z-index: 2;
}
.carousel__playback svg {
opacity: 0.75;
}
.carousel__playback .icon--play {
padding-left: 1px;
}
.carousel__list--image-treatment > li {
align-items: center;
border-radius: 8px;
display: flex;
justify-content: center;
overflow: hidden;
position: relative;
}
.carousel__list--image-treatment > li:after {
background: rgba(0, 0, 0, 0.05);
bottom: 0;
content: "";
display: block;
left: 0;
pointer-events: none;
position: absolute;
right: 0;
top: 0;
}
.carousel__list--image-treatment > li > img {
display: inline-block;
max-height: 100%;
max-width: 100%;
object-fit: contain;
}
.carousel__list--image-treatment-large > li {
align-items: center;
border-radius: 16px;
display: flex;
justify-content: center;
overflow: hidden;
position: relative;
}
.carousel__list--image-treatment-large > li:after {
background: rgba(0, 0, 0, 0.05);
bottom: 0;
content: "";
display: block;
left: 0;
pointer-events: none;
position: absolute;
right: 0;
top: 0;
}
.carousel__list--image-treatment-large > li > img {
display: inline-block;
max-height: 100%;
max-width: 100%;
object-fit: contain;
}
div.carousel {
margin: 16px 0;
}
.carousel__control {
align-items: center;
background-color: var(
--carousel-paddle-background-color,
var(--color-background-primary)
);
border: 1px solid;
border-color: var(
--carousel-paddle-border-color,
var(--color-stroke-subtle)
);
border-radius: 16px;
box-shadow:
0 2px 2px 0 rgba(0, 0, 0, 0.24),
0 0 2px 0 rgba(0, 0, 0, 0.12);
display: flex;
font-size: 18px;
height: 32px;
justify-content: center;
opacity: 0;
padding: 0;
position: absolute;
top: 50%;
transform: translateY(-50%);
transition: opacity 0.45s ease-in-out;
width: 32px;
z-index: 1;
}
.carousel__control--prev {
left: calc(var(--spacing-200) * -1);
margin-inline-end: 1px;
}
.carousel__control--next {
margin-inline-start: 1px;
right: calc(var(--spacing-200) * -1);
}
.carousel__control svg {
color: var(
--carousel-paddle-foreground-color,
var(--color-foreground-primary)
);
}
.carousel__control:focus:not(:focus-visible) {
outline: none;
}
@media (min-width: 512px) {
.carousel:focus-within .carousel__control {
opacity: 0.92;
}
.carousel:focus-within .carousel__control[aria-disabled="true"] {
opacity: 0.3;
}
}
@media (min-width: 512px) and (hover: hover) {
.carousel:hover .carousel__control {
opacity: 0.92;
}
.carousel:hover .carousel__control[aria-disabled="true"] {
opacity: 0.3;
}
}
.carousel__control--show,
.carousel__control:focus {
opacity: 0.92;
}
.carousel__control--show[aria-disabled="true"],
.carousel__control:focus[aria-disabled="true"] {
opacity: 0.3;
}
.carousel__control:hover {
background-color: var(--color-state-primary-hover);
border-color: var(--color-state-primary-hover);
}
.carousel__control:hover svg {
color: var(
--carousel-paddle-hover-foreground-color,
var(--color-foreground-primary)
);
}
.carousel__control:active {
background-color: var(--color-state-primary-active);
}
.carousel__playback:focus:not(:focus-visible) {
outline: none;
}
span.carousel,
span.carousel__container {
display: inline-block;
}
.carousel__viewport--mask {
-webkit-mask-image: linear-gradient(
to right,
var(--color-background-primary) 85%,
rgba(0, 0, 0, 0) 100%
);
mask-image: linear-gradient(
to right,
var(--color-background-primary) 85%,
rgba(0, 0, 0, 0) 100%
);
}
[dir="rtl"] .carousel__control--prev {
left: unset;
right: calc(var(--spacing-200) * -1);
}
[dir="rtl"] .carousel__control--next {
left: calc(var(--spacing-200) * -1);
right: unset;
}
[dir="rtl"] .carousel__control .icon--12 {
transform: rotate(180deg);
}
/* autoprefixer: ignore next */
@supports not /*!Y */
(
/*!Y */ (-webkit-scroll-snap-coordinate: 0 0) or /*!Y */
(-ms-scroll-snap-coordinate: 0 0) or /*!Y */
(scroll-snap-coordinate: 0 0) or /*!Y */ (scroll-snap-align: start)
) {
.carousel:not(.carousel__autoplay) .carousel__control {
opacity: 0.92;
}
.carousel:not(.carousel__autoplay)
.carousel__control[aria-disabled="true"] {
opacity: 0.3;
}
}
/* autoprefixer: ignore next */
@supports (
/*!Y */ (-webkit-scroll-snap-coordinate: 0 0) or /*!Y */
(-ms-scroll-snap-coordinate: 0 0) or /*!Y */
(scroll-snap-coordinate: 0 0) or /*!Y */ (scroll-snap-align: start)
) {
.carousel:not(.carousel__autoplay) {
overflow: visible;
}
.carousel:not(.carousel__autoplay) .carousel__control {
margin-top: -5px;
}
.carousel:not(.carousel__autoplay) .carousel__list {
border-color: rgba(0, 0, 0, 0);
-webkit-overflow-scrolling: touch;
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 10px;
scroll-behavior: smooth;
scroll-snap-type: proximity;
scroll-snap-type: x proximity;
scrollbar-color: rgba(0, 0, 0, 0) rgba(0, 0, 0, 0);
scrollbar-width: thin;
transition:
border-color 0.5s,
scrollbar-color 0.5s,
transform 0.45s ease-in-out;
}
.carousel:not(.carousel__autoplay) .carousel__list:hover {
border-color: rgba(0, 0, 0, 0.4);
scrollbar-color: rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0);
}
.carousel:not(.carousel__autoplay) .carousel__list::-webkit-scrollbar {
height: 5px;
}
.carousel:not(.carousel__autoplay)
.carousel__list::-webkit-scrollbar-thumb {
border-color: inherit;
border-radius: 4px;
border-right-style: inset;
border-right-width: calc(100vw + 100vh);
}
.carousel__snap-point {
scroll-snap-align: flex-start;
scroll-snap-coordinate: 0 0;
}
@media (min-width: 512px) {
div.carousel {
margin: 16px 0;
}
}
}
.carousel.carousel--hidden-scrollbar:not(.carousel__autoplay) {
overflow: hidden;
}
.carousel--hidden-scrollbar .carousel__container {
margin-bottom: -80px;
}
.carousel--hidden-scrollbar .carousel__container .carousel__control {
margin-top: -40px;
}
.carousel--hidden-scrollbar .carousel__container .carousel__list {
padding-bottom: 80px;
}
.carousel--hidden-scrollbar .carousel__control--prev {
left: 0;
}
.carousel--hidden-scrollbar .carousel__control--next {
right: 0;
}