Reputation: 8971
I am using Facebook's Draft.js library to create a rich text box and I have a requirement to make the caret of the text box red. Is it possible?
I have read about the -webkit-text-fill-color
property but it is making the typed text and the placeholder red instead of the caret.
Upvotes: 0
Views: 1392
Reputation: 8680
This will make the caret red, and the text black, in webkit browsers:
.public-DraftEditor-content {
color: red;
text-shadow: 0px 0px 0px #000;
-webkit-text-fill-color: transparent;
}
Here's a fiddle showing it in action: https://jsfiddle.net/2atqzz5r/
Update: As of Chrome 57, you can use the new property caret-color:
.public-DraftEditor-content {
caret-color: red;
}
https://jsfiddle.net/yuk0fogn/
Upvotes: 4