A bordered, tilted label slams down from above like a rubber stamp, shudders on impact and leaves a ring of ink that spreads and fades. Good for approvals, badges and sold-out tags.
Also known as: stamp animation css, approved stamp effect, slam in text.
<div class="txt-rubber-stamp-text">Approved</div>
.txt-rubber-stamp-text {
--c: var(--txt-color, #3b82f6);
font-size: var(--txt-size, 32px);
font-family: system-ui, sans-serif;
font-weight: 700;
line-height: 1.2;
position: relative;
display: inline-block;
padding: 0.12em 0.45em;
border: 0.1em solid var(--c);
border-radius: 0.2em;
color: var(--c);
font-weight: 800;
letter-spacing: 0.12em;
text-transform: uppercase;
transform: rotate(-8deg);
animation: txt-rubber-stamp-text-slam 0.8s both;}
/* the ink ring that spreads on impact */
.txt-rubber-stamp-text::after {
content: "";
position: absolute;
inset: -0.1em;
border: 0.06em solid var(--c);
border-radius: 0.3em;
opacity: 0;
animation: txt-rubber-stamp-text-ring 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) 0.34s both;
}
@keyframes txt-rubber-stamp-text-slam {
0% { opacity: 0; transform: rotate(-13deg) scale(1.7) translateX(0); animation-timing-function: cubic-bezier(0.6, 0, 1, 0.6); }
20% { opacity: 0.8; }
42% { opacity: 1; transform: rotate(-8deg) scale(0.93) translateX(0); animation-timing-function: ease-out; }
52% { transform: rotate(-9.5deg) scale(1.03) translateX(0.04em); }
62% { transform: rotate(-6.8deg) scale(0.99) translateX(-0.04em); }
74% { transform: rotate(-8.6deg) scale(1) translateX(0.02em); }
86% { transform: rotate(-7.7deg) scale(1) translateX(0); }
100% { opacity: 1; transform: rotate(-8deg) scale(1) translateX(0); }
}
@keyframes txt-rubber-stamp-text-ring {
from { opacity: 0.6; transform: scale(1); }
to { opacity: 0; transform: scale(1.35); }
}
@media (prefers-reduced-motion: reduce) {
.txt-rubber-stamp-text, .txt-rubber-stamp-text *, .txt-rubber-stamp-text::before, .txt-rubber-stamp-text::after, .txt-rubber-stamp-text *::before, .txt-rubber-stamp-text *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}--txt-color on the element or a parent.
Currently previewing #3b82f6.--txt-size. Every other dimension is in
em, so the whole thing scales together. Currently previewing 40px.transition or animation
shorthand. Staggered delays are relative, so they keep their rhythm.