CSS caret-* properties and custom caret accessibility ⌨️
Go back

CSS caret-* properties and custom caret accessibility ⌨️

Sara Soueidan's deep dive into modern CSS caret styling properties (caret-color, caret-shape, caret-animation) and how they affect web accessibility.

CSS caret-* properties and custom caret accessibility ⌨️

In a recent deep dive, Sara Soueidan thoroughly examined modern CSS properties for styling the text insertion cursor (caret-color, caret-shape, caret-animation) and how they impact accessibility—both in standard form inputs and in Caret Browsing mode.

What to keep in mind before customizing the caret

  • Contrast: a custom caret must maintain at least a 3:1 contrast ratio against its background; otherwise, low-vision users will easily lose track of it.
  • Animation and blinking: overly rapid blinking via caret-animation can violate WCAG flash thresholds and trigger discomfort for people with vestibular disorders or photosensitivity.
  • Overriding OS preferences: by overriding caret behavior in CSS, you break the thickness, color, and blink rate settings that users have deliberately configured for themselves at the operating system level.
  • Visible focus: the caret is no substitute for a proper focus indicator—a clear :focus-visible outline must always remain in place.

Honestly, I see no reason to take over the browser’s rendering of fundamental system UI elements like scrollbars or carets. Give developers the tools to customize them, and nine times out of ten it turns into unreadable visual clutter. So let’s take note that CSS can do this, and quietly keep it away from product managers just in case 😅

👉 Read Sara Soueidan’s article

Copied