W3C home > Mailing lists > Public > www-style@w3.org > April 2012

Fwd: [css4-ui] ::tooltip

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Wed, 11 Apr 2012 19:54:02 -0700
Message-ID: <CALRQH79XFU1Sksb+L8p1eXeCcOECecnzm=EhcrgxQhwFeQa3-A@mail.gmail.com>
To: www-style@w3.org
On Wed, Apr 11, 2012 at 4:09 PM, Lea Verou <leaverou@gmail.com> wrote:
> On 11/4/12 13:30, Andrew Fedoniouk wrote:
>>
>> That are just few details. In any case :tooltip or :popup should be
>> pseudo-classes that define runtime state of the element rather than
>> pseudo-elements as someone proposed in this discussion.
>
> Pseudo-classes reflect *state*, not separate containers to apply the rules
> to. So, if :tooltip was a pseudo-class, the declarations within the rule
> would style the element itself when a tooltip was shown. For example,
>
>    div[title]:tooltip { background: gold; }
>
> would give the div itself a gold background when the tooltip is shown.
>  Which could be useful, but not much. The point here is to be able to style
> the tooltip itself, and this screams "pseudo-element".
>

There is one tooltip on the screen at any given moment of time so
:tooltip { background:gold; }
will work just fine.

If you want different styling for different elements then we can use shadow
tree combinator/selector here:

div[title] -> :tooltip { background: gold; }
div[title] -> :tooltip { background: green; }

where '->' is that shadow tree combinator (does not exist yet but
it seems we are getting there).

--
Andrew Fedoniouk.

http://terrainformatica.com


-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Thursday, 12 April 2012 02:54:30 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:52 GMT