body {
margin: 0;
min-height: 100vh;
display: grid;
place-items: center;
background: #fafaf8;
color: #6f727b;
font: 15px/1.4 system-ui, sans-serif;
}
.logos {
/* A viewport-based width, so the long tracks can't stretch the page grid. */
width: min(760px, 100vw - 32px);
}
.logos__title {
margin: 0 0 18px;
font-size: 0.85rem;
text-align: center;
}
.marquee {
--gap: 56px;
display: flex;
gap: var(--gap);
overflow: hidden;
mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.marquee__track {
display: flex;
flex: none;
gap: var(--gap);
margin: 0;
padding: 0;
list-style: none;
animation: scroll 24s linear infinite;
}
.marquee__track li {
color: #3c3f47;
font-size: 1.5rem;
white-space: nowrap;
}
.marquee:hover .marquee__track {
animation-play-state: paused;
}
@keyframes scroll {
to {
transform: translateX(calc(-100% - var(--gap)));
}
}
@media (prefers-reduced-motion: reduce) {
.marquee {
mask-image: none;
}
.marquee__track {
flex-wrap: wrap;
justify-content: center;
animation: none;
}
.marquee__track[aria-hidden="true"] {
display: none;
}
}Usage
The list is rendered twice and the track moves by exactly half its width, so the loop is seamless. The second copy is
aria-hidden. The edge fade is a mask-image gradient. Under reduced motion the logos wrap instead of scrolling.