Re: [Proposal] CSS 'tooltip' Property

Binyamin 於 4/20/2017 2:03 AM 寫道:
> Any progress for ::tooltip pseudo-element proposal? Any spec drafts?
> 2009 discussion 
> http://lists.w3.org/Archives/Public/www-style/2009Apr/0225.html

This feature isn't in CSS4 UI, where I'd expect it: 
https://drafts.csswg.org/css-ui-4/.

While it'd be nice to have, it won't solve all tooltip use cases. For 
example, for abbreviation tooltips, I show all "sub-abbreviations" in 
the tooltip and that is content that belongs in (HTML) markup, not a CSS 
pseudo-element. I think we'd need things like...

<tooltip>Tooltip Text</tooltip> (HTML)

position: cursor;
cursor-box-align: <length> [[[ after | after-before | before | over | 
over-under | under ] center-to-cursor? ] | toward-viewport-center ];

... to address that case. (We have <dialog>Tooltip Text</dialog> which 
has semantics that fit tooltips, but that solution would still require 
JavaScript even with this hypothetical CSS because the element is 
prohibited inside phrasing content elements.)

It also doesn't address the case where you want a stylistic abbreviation 
with a tooltip for consistency with HTML-based abbreviation tooltips. 
We'd need something like...

content: tooltip("Pseudo-Element Abbreviation Text", "Pseudo-Element 
Abbreviation Tooltip Text") " ";

...to address that use case. I've needed this when stylistically 
prefixing ISBN numbers in a table with "ISBN " (with a trailing space).

Received on Thursday, 20 April 2017 17:54:57 UTC