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

Re: [css4-ui] ::tooltip

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Wed, 11 Apr 2012 19:53:22 -0700
Message-ID: <CALRQH79Vr9AzO_foV40WibVBJZxq7naXtu4sQ4Ga3LJHZby3yA@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: "Belov, Charles" <Charles.Belov@sfmta.com>, Lea Verou <leaverou@gmail.com>, www-style list <www-style@w3.org>
On Wed, Apr 11, 2012 at 5:15 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Wed, Apr 11, 2012 at 5:05 PM, Belov, Charles <Charles.Belov@sfmta.com> wrote:
>> Lea Verou wrote at Wednesday, April 11, 2012 4:09 PM
>>> 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".
>> No, it would be very useful for accessibility, e.g., in a personal style sheet:
>> *:tooltip { font-size: large; }
> What are you intending that to do?  If you want the tooltip to use a
> larger font-size, then you want the pseudo-element:
> *::tooltip { font-size: large; }
> ~TJ

Use of pseudo-element for that purposes effectively disables
case when tooltip is created from other DOM element like this:

  <div id="warning-tooltip"><img src="warning.png"> Achtung, minen! </div>
  <div title-id="warning-tooltip">
      Attention! Mines!

There will be no element that will match ::tooltip in this case.

Andrew Fedoniouk.

Received on Thursday, 12 April 2012 02:53:51 UTC

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