Letters printed on a paper swatch with a pink and a halftone yellow plate that drift in and out of register. The plates multiply over your accent, so overlaps darken like real ink.
Also known as: risograph text effect, offset print text css, misprint text effect.
<div class="txt-misprint-text" data-text="PRINTED">PRINTED</div>
.txt-misprint-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;
isolation: isolate;
padding: 0.3em 0.65em;
border-radius: 0.08em;
background: #f6f1e6;
box-shadow: 0 0.08em 0.3em -0.1em rgb(0 0 0 / 0.3);
color: color-mix(in srgb, var(--c) 80%, #fff);
font-weight: 900;
letter-spacing: 0.04em;}
.txt-misprint-text::before,
.txt-misprint-text::after {
content: attr(data-text);
position: absolute;
inset: 0;
padding: inherit;
mix-blend-mode: multiply;
animation: 3.6s ease-in-out infinite alternate;
}
.txt-misprint-text::before {
color: #ff6fc4;
animation-name: txt-misprint-text-pink;
}
.txt-misprint-text::after {
color: #ffb000;
-webkit-mask-image: radial-gradient(circle, #000 0.03em, transparent 0.04em);
mask-image: radial-gradient(circle, #000 0.03em, transparent 0.04em);
-webkit-mask-size: 0.09em 0.09em;
mask-size: 0.09em 0.09em;
animation-name: txt-misprint-text-yellow;
animation-duration: 2.8s;
}
@keyframes txt-misprint-text-pink {
from { transform: translate(-0.05em, 0.03em); }
to { transform: translate(-0.14em, 0.08em); }
}
@keyframes txt-misprint-text-yellow {
from { transform: translate(0.08em, -0.05em); }
to { transform: translate(0.03em, 0.09em); }
}
@media (prefers-reduced-motion: reduce) {
.txt-misprint-text, .txt-misprint-text *, .txt-misprint-text::before, .txt-misprint-text::after, .txt-misprint-text *::before, .txt-misprint-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.