CSS Function
caret-color
The caret-color property sets the color of the text insertion cursor (caret) in editable elements like inputs and textareas.
Syntax
caret-color: auto | <color>Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| auto | keyword | No | Uses currentcolor or UA-determined color |
| color | color | No | Any valid CSS color value for the caret |
Examples
Brand-colored caret
Blue caret in text inputs.
css
input {
caret-color: #3b82f6;
}Transparent caret
Hides the caret visually.
css
input.no-caret {
caret-color: transparent;
}Tailwind utility
Tailwind provides caret-{color} utilities.
html
<input class="caret-blue-500" />Browser Support
✓
Chrome
v57++
✓
Firefox
v53++
✓
Safari
v11.1++
✓
Edge
v79++
✓
Opera
v44++
Tailwind Equivalent
You can achieve similar results in Tailwind CSS using the following utility classes:
caret-{color}: caret-blue-500, caret-red-600, etc.Frequently Asked Questions
Can I animate the caret color?▼
Yes. caret-color is animatable and can be transitioned between colors using CSS transitions or animations.
Explore CSS Color Tools
Try our free tools to work with caret-color and other CSS color functions.
Open Tools