CSS typewriter animation in React without layout shift
We turned the static code block in our hero into a typewriter animation. It immediately started to scroll sideways and jump in height. Here is how we fixed both in React and CSS, with container queries and a bit of monospace math.