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

[css3-text] pseudo-element for styling text decoration (and emphasis dots) (was: [css3-text] graphical effects and text-decoration)

From: Kang-Hao (Kenny) Lu <kennyluck@csail.mit.edu>
Date: Thu, 12 Jan 2012 06:15:14 +0800
Message-ID: <4F0E09F2.7040500@csail.mit.edu>
To: WWW Style <www-style@w3.org>
(12/01/06 18:24), Robert O'Callahan wrote:
> I can't think of any reason authors would want to have filters or opacity
> not apply to text decorations. Possibly authors might want to apply
> text-shadow or fill-with-pattern differently to the decorations, but we
> could mint new properties (similar to 'text-decoration-color') if that was
> desirable. Note that SVG defines 'fill' to apply equally to both text and
> its decorations.

I might be too late to raise this discussion but I've been wondering if
we can reuse properties on a new pseudo-element, say, ::text-decoration,
instead of minting new text-decoration-* for uncommon use case like this.

There's request for text-decoration-width and text-decoration-offset[1],
and if we are to address emphasis dots with offset (I believe I've seen
these, but I don't have pictures with me) we would need
text-emphasis-offset-x and text-emphasis-offset-y. But if we employ
::text-decoration and use

* bottom/top instead of text-*-offset-y
* left/right instead of text-*-offest-y
* font-size instead of text-decoration-width (not sure if this is making
sense for text decoration but for emphasis dots it is natural)
* color instead of text-*-color

then we don't need to bloat the property namespace with these rather
uncommon properties. (So ::text-decoration doesn't generate boxes and is
more like a collection of properties that applies to text
decoration/emphasis.)

I don't know if we can map parts of shorthand properties on the
corresponding properties of the pseudo element, but if we can, we can
keep the shorthand as it is, as long as properties that don't have
equivalents like text-decoration-position.

[1] http://lists.w3.org/Archives/Public/www-style/2011Mar/0614

Cheers,
Kenny
Received on Wednesday, 11 January 2012 22:15:55 GMT

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