[csswg-drafts] [css-ui-4] inteference with the caret blinking and the ability to animate its color (#9707)

frivoal has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-ui-4] inteference with the caret blinking and the ability to animate its color ==
Using `caret-color`, you can change the color of the text insertion caret. Using css animations, you can animate that color. Using this, people could create carets that:

* fade in and out instead of blinking
(variations around this concept are for instance available in VS Code: https://www.youtube.com/watch?v=Hms3gUBKaVQ)

* alternate between two (or more) colors instead of alternate between visible and invisible, such as a bright and a subdued variant of the same color.
(This is an effect that can for instance be seen in Bloomberg Terminal https://www.youtube.com/watch?v=MaWWOQgAMLY&t=115s )

Well, you almost could do that, but in practice it doesn't work, because at the same time as you are animating the caret color, it's still blinking. So instead, people who try to do this sort of things hide the caret (by making it transparent), place an empty div where the caret is (and use JavaScript to track it around) just so they can style it. This is cumbersome and brittle.

A while back, we had explored a `caret-animation` property, with one value (`auto`) letting the caret blink or animate in whatever way is native to the platform, and one value (we last called it `none`, but I would actually rather go with `manual`) making the caret just be the color of `caret-color`, allowing animations to do their work undisrupted. This would be easy to implement, and would remove the need for complicated workarounds.

I would like to revive this.

(We could have a couple of convenience values, such as `fade` or `blink`, but these don't enable anything that isn't possible with animations once we have `manual`)



Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9707 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 14 December 2023 13:47:57 UTC