v132 · css
CSS caret-animation property
Chromium supports animation of the caret-color property, but the platform caret blink can interfere with author keyframes. caret-animation lets authors choose auto for the user-agent behavior or manual when CSS animation should control the caret.
concepts
-
caret-animation
Override the system caret blink.
-
blink tempo
Use
caret-animation: manualwith author keyframes to pick your own blink rate, timing function, and colour sequence. -
preset gallery
Six ready-to-paste caret styles: typewriter, pulse, matrix, pride, heartbeat, terminal. Click any input to see the cursor cycle; copy the CSS underneath.
-
accessibility & reduced motion
The naive version always animates. The respectful version turns the animation off under
prefers-reduced-motion: reduceand hands the blink back to the system. -
Chat Input
A chat interface where the caret changes per input mode:
autofor normal text,manualsteady for code snippets, andmanualwith keyframes for @mention mode. -
Code Editor
An editor mockup with four Vim-style modes. Each mode sets
caret-color,caret-animation: manual, and optional author keyframes via adata-modeselector.
why it shipped
When the caret-color is animated the default blinking cursor interferes with the animation. This CSS property enables authors to disable the blinking when animating the caret color.