How to make cursor blinking on the focus input?
Closed this issue · 6 comments
broodfusion commented
As title suggests, thanks
andreaswilli commented
Depends on what you mean by "blinking cursor":
- If you mean a native cursor: This is not possible since the visible part of the component is not acutally an input element.
- If you mean the selected field indicator: You can make it blink using a css animation like so:
.character--selected {
animation: blink 1s infinite;
}
@keyframes blink {
0% {
outline: orange 3px solid;
}
50% {
outline: orange 3px solid;
}
51% {
outline: none;
}
100% {
outline: none;
}
}
broodfusion commented
Thanks I've figured it out using a similar solution
giopetris commented
@broodfusion were you able to make this look like a real cursor?
andreaswilli commented
I added a complete example to the docs.
billsbooth commented
andreaswilli commented
It's an example to use as a starting point.
Feel free to adapt the values, as they depend on the concrete typeface, etc.
That's also why this is not built into the library.