Letters start as a dotted tracing outline, the dots stretch into dashes and join into a solid line, then a light fill settles in. The dots are zero-length dashes with round caps.
Also known as: dotted outline text css, connect the dots text, dashed to solid stroke animation.
<svg class="txt-dotted-to-solid-outline" viewBox="0 0 420 110" role="img" aria-label="TRACE"><text x="210" y="86" text-anchor="middle" font-size="92">TRACE</text></svg>
.txt-dotted-to-solid-outline {
--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: 9.5em;
height: auto;
overflow: visible;}
.txt-dotted-to-solid-outline text {
font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
font-weight: 900;
fill: var(--c);
fill-opacity: 0;
stroke: var(--c);
stroke-width: 3.4;
stroke-linecap: round;
stroke-linejoin: round;
/* a zero-length dash with a round cap is a dot */
stroke-dasharray: 0 9;
animation:
txt-dotted-to-solid-outline-join 1.4s cubic-bezier(0.65, 0, 0.35, 1) 0.4s forwards,
txt-dotted-to-solid-outline-fill 0.6s ease-out 1.6s forwards;
}
@keyframes txt-dotted-to-solid-outline-join {
to { stroke-dasharray: 9 0; }
}
@keyframes txt-dotted-to-solid-outline-fill {
to { fill-opacity: 0.2; }
}
@media (prefers-reduced-motion: reduce) {
.txt-dotted-to-solid-outline, .txt-dotted-to-solid-outline *, .txt-dotted-to-solid-outline::before, .txt-dotted-to-solid-outline::after, .txt-dotted-to-solid-outline *::before, .txt-dotted-to-solid-outline *::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.