Skip to content

Diagonal Bands

Cross two tilted bands of large text, like a promo banner on a store page. The CSS rotate property tilts each marquee, reversed sends the back band the other way, and aria-hidden="true" stops the back band from repeating the same text to screen readers.

To hide the ends of the bands, each band is wider than the clipping container.

Reduced Motion

Your system is set to reduce motion. The bands do not move, and you can scroll them by hand.

Free shipping over $50 30-day returns Carbon-neutral delivery Gift wrap on request

Code

The following example assumes that you have imported the component and set up the theme.

Diagonal Bands
<div class="diagonal-bands">
13 collapsed lines
<sv-marquee class="band band-back" aria-hidden="true" reversed speed="40">
<span>Free shipping over $50</span>
<span>30-day returns</span>
<span>Carbon-neutral delivery</span>
<span>Gift wrap on request</span>
</sv-marquee>
<sv-marquee class="band band-front" aria-label="Store benefits" role="list" speed="40">
<span role="listitem">Free shipping over $50</span>
<span role="listitem">30-day returns</span>
<span role="listitem">Carbon-neutral delivery</span>
<span role="listitem">Gift wrap on request</span>
</sv-marquee>
</div>
<style>
39 collapsed lines
.diagonal-bands {
display: grid;
place-items: center;
block-size: 14rem;
overflow: clip;
.band {
--sv-marquee-gap: 2rem;
grid-area: 1 / 1;
inline-size: 120%;
padding-block: 0.8em;
font-size: 1.25rem;
font-weight: 800;
text-transform: uppercase;
letter-spacing: 0.04em;
span {
white-space: nowrap;
&::after {
margin-inline-start: 2rem;
content: "✦" / "";
}
}
}
.band-back {
color: var(--sv-gray-0);
background-color: var(--sv-gray-5);
rotate: 4deg;
}
.band-front {
color: var(--sv-accent-content);
background-color: var(--sv-accent);
rotate: -4deg;
}
}
</style>