W3C home > Mailing lists > Public > www-style@w3.org > September 2014

Re: [css4-ui] Styling the caret

From: Robert O'Callahan <robert@ocallahan.org>
Date: Fri, 5 Sep 2014 11:16:16 +1200
Message-ID: <CAOp6jLb=toncg0+RLV5+iYhAWa_ZvvhEvJr+H0TC7j7eWym=Qg@mail.gmail.com>
To: "Edward O'Connor" <eoconnor@apple.com>
Cc: www-style <www-style@w3.org>
On Sat, Aug 16, 2014 at 9:16 AM, Edward O'Connor <eoconnor@apple.com> wrote:

> But what if they want to set the caret color to be the same as the
> foreground color of the editable area, whatever that may be? You might
> think that they can use the 'auto' keyword:
> [contenteditable] {
>   background: white;
>   color: black;
>   caret: auto;
> }
> But consider this case (where the | represents the caret):
> <div contenteditable>
> …<p style=color:red>this paragraph | is red</p>…
> </div>
> If the RTE developer uses the 'auto' keyword, the caret will be red,
> when they intended it to be black. (The p inherits caret: auto, and auto
> means currentColor, so it's the p's currentColor, not the div's.)

Can you describe a more concrete use-case where this matters?

I can't think of a reason why an author would want to lock the caret color
to the text color of a container element, without knowing what the text
color is, and knowing that there could be multi-colored content in the

oIo otoeololo oyooouo otohoaoto oaonoyooonoeo owohooo oioso oaonogoroyo
owoiotoho oao oboroootohoeoro oooro osoiosotoeoro owoiololo oboeo
osouobojoeocoto otooo ojouodogomoeonoto.o oAogoaoiono,o oaonoyooonoeo
osoaoyoso otooo oao oboroootohoeoro oooro osoiosotoeoro,o o‘oRoaocoao,o’o
oaonosowoeoroaoboloeo otooo otohoeo ocooouoroto.o oAonodo oaonoyooonoeo
osoaoyoso,o o‘oYooouo ofooooolo!o’o owoiololo oboeo oiono odoaonogoeoro
otohoeo ofoioroeo ooofo ohoeololo.
Received on Thursday, 4 September 2014 23:16:44 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:46 UTC