The Open Standard for Generative UI
@use "../../../cssUtils" as cssUtils;
.openui-small-card-block {
--openui-small-card-gap: #{cssUtils.$space-m};
width: 100%;
container-type: inline-size;
&[data-layout="carousel"] {
padding: 0;
}
}
.openui-small-card-block__grid {
display: flex;
flex-direction: column;
gap: var(--openui-small-card-gap);
width: 100%;
}
.openui-small-card-block__row {
display: grid;
gap: var(--openui-small-card-gap);
width: 100%;
align-items: stretch;
}
.openui-small-card-block__row--1 {
grid-template-columns: 1fr;
}
.openui-small-card-block__row--2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.openui-small-card-block__row--3 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.openui-small-card-block__item {
display: grid;
width: 100%;
min-width: 0;
}
.openui-small-card-block__carousel {
width: 100%;
overflow-x: auto;
overflow-y: visible;
scrollbar-width: none;
-ms-overflow-style: none;
&::-webkit-scrollbar {
display: none;
}
&--mask-left.openui-small-card-block__carousel--mask-right {
mask-image: linear-gradient(
to right,
#0000,
#000 #{cssUtils.$space-3xl},
#000 calc(100% - #{cssUtils.$space-3xl}),
#0000
);
-webkit-mask-image: linear-gradient(
to right,
#0000,
#000 #{cssUtils.$space-3xl},
#000 calc(100% - #{cssUtils.$space-3xl}),
#0000
);
}
&--mask-left:not(.openui-small-card-block__carousel--mask-right) {
mask-image: linear-gradient(to right, #0000, #000 #{cssUtils.$space-3xl}, #000);
-webkit-mask-image: linear-gradient(to right, #0000, #000 #{cssUtils.$space-3xl}, #000);
}
&--mask-right:not(.openui-small-card-block__carousel--mask-left) {
mask-image: linear-gradient(to left, #0000, #000 #{cssUtils.$space-3xl}, #000);
-webkit-mask-image: linear-gradient(to left, #0000, #000 #{cssUtils.$space-3xl}, #000);
}
}
.openui-small-card-block__carousel-track {
display: flex;
gap: var(--openui-small-card-gap);
padding: cssUtils.$space-2xs 0;
width: max-content;
}
.openui-small-card-block__carousel-item {
display: grid;
flex-shrink: 0;
width: 17.5rem;
}
.openui-small-card-block__grid--responsive {
@container (max-width: 48rem) {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: var(--openui-small-card-gap);
.openui-small-card-block__row {
display: contents;
}
}
@container (max-width: 30rem) {
grid-template-columns: 1fr;
}
}
.openui-small-card-block__grid--odd-count {
@container (max-width: 48rem) {
.openui-small-card-block__row:last-child > .openui-small-card-block__item:last-child {
grid-column: 1 / -1;
}
}
}
.openui-small-card-block__carousel--responsive {
@container (max-width: 30rem) {
.openui-small-card-block__carousel-item {
width: 15rem;
}
}
}
.openui-small-card-block--overview-card.openui-small-card-block--carousel {
.openui-small-card-block__carousel-item {
width: 15rem;
}
@container (max-width: 30rem) {
.openui-small-card-block__carousel-item {
width: 12.5rem;
}
}
}