The whole word scales up from half size with a little overshoot, like a notification badge appearing. One keyframe and a springy easing curve.
Also known as: scale in text, zoom in text, bounce in.
<div class="txt-pop-in">New!</div>
.txt-pop-in {
--c: var(--txt-color, #3b82f6);
font-size: var(--txt-size, 32px);
font-family: system-ui, sans-serif;
font-weight: 700;
line-height: 1.2;
display: inline-block;
color: var(--c);
opacity: 0;
animation: txt-pop-in-scale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;}
@keyframes txt-pop-in-scale {
from { opacity: 0; transform: scale(0.5); }
to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
.txt-pop-in, .txt-pop-in *, .txt-pop-in::before, .txt-pop-in::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.