AI CSS Animations

Sticker Text Effect

The word slaps on like a sticker: it spins in, overshoots, and a thick rounded border grows out around every letter. SVG text with paint-order: stroke, so the border sits behind the fill.

Also known as: die cut sticker text css, thick text outline, sticker slap animation.

Hello!

HTML

<svg class="txt-sticker-text" viewBox="0 0 300 110" role="img" aria-label="Hello!"><text x="150" y="76" text-anchor="middle" font-size="72">Hello!</text></svg>

CSS

.txt-sticker-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;
  width: 7em;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 0.05em 0.05em color-mix(in srgb, var(--c) 55%, transparent));
  opacity: 0;
  transform: scale(0.4) rotate(-18deg);
  animation: txt-sticker-text-slap 0.75s forwards;}
.txt-sticker-text text {
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-weight: 900;
  fill: var(--c);
  stroke: color-mix(in srgb, var(--c) 14%, #fff);
  stroke-width: 0;
  stroke-linejoin: round;
  paint-order: stroke;
  animation: txt-sticker-text-border 0.5s cubic-bezier(0.3, 1.5, 0.6, 1) 0.3s forwards;
}
@keyframes txt-sticker-text-slap {
  0%   { opacity: 0; transform: scale(0.4) rotate(-18deg); animation-timing-function: cubic-bezier(0.3, 0, 0.6, 1); }
  45%  { opacity: 1; transform: scale(1.1) rotate(3deg); animation-timing-function: ease-in-out; }
  75%  { transform: scale(0.97) rotate(-6deg); }
  100% { opacity: 1; transform: scale(1) rotate(-4deg); }
}
@keyframes txt-sticker-text-border {
  to { stroke-width: 16; }
}

@media (prefers-reduced-motion: reduce) {
  .txt-sticker-text, .txt-sticker-text *, .txt-sticker-text::before, .txt-sticker-text::after, .txt-sticker-text *::before, .txt-sticker-text *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

Customizing this snippet

  • Color: set --txt-color on the element or a parent. Currently previewing #3b82f6.
  • Font size: set --txt-size. Every other dimension is in em, so the whole thing scales together. Currently previewing 40px.
  • Speed: change the duration on the transition or animation shorthand. Staggered delays are relative, so they keep their rhythm.
  • Reduced motion: the rule at the end of the CSS turns the motion off for people who asked their OS for less of it. Keep it.

Similar text animations