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

Re: [css3-text] Styling of text decoration

From: Kang-Hao (Kenny) Lu <kanghaol@oupeng.com>
Date: Sat, 28 Jul 2012 18:21:40 +0000
Message-ID: <50113DF3.30108@oupeng.com>
To: Sebastian Zartner <sebastianzartner@gmx.de>
CC: Lutz Issler <lutz.issler@systemantics.net>, WWW Style <www-style@w3.org>
(12/07/25 19:15), Sebastian Zartner wrote:
> (12/07/25 18:33), Lutz Issler wrote:
>> I must say "text-underline-position" is quite attractive from the 
>> typographic points of view. What about the following proposal:
>>
>> -----
>> The vertical position of the decoration line is determined by the base 
>> position, shifted by "text-decoration-offset". The base position of the 
>> decoration line is determined by "text-decoration-line" [1] and 
>> "text-decoration-position" [2].
>> -----

That looks like a fine proposal with enough details
(s/text-decoration-position/text-underline-position/ though)

> Well, that would be the third property influencing the vertical position of the decoration.
> 
> Maybe a better approach would be to combine "text-decoration-line", "text-underline-position" and "text-decoration-offset" to one property called "text-decoration-position".
> 
> The syntax for its value would be:
> 
> none | [ underline || underline-below || left || right || overline || line-through ] [ <length> | <percentage> ]
> 
> So to say you want to have an alphabetic underline with an offset of 2px, you would write this:
> 
> text-decoration-position: underline 2px;
> 
> If you want to have an underline used in accounting with an offset 2px and an overline with offset 0.1em, you would write this:
> 
> text-decoration-position: underline-below 2px, overline 0.1em;

I assume that in in this model, 'text-decoration-position' is a longhand
of 'text-decoration'? I think this doesn't work and the reason why
'underline-below' is re-positioned 'underline' instead of a new line is
that 'text-underline-position' is designed so that it is independent of
'text-decoration' because it can come from another stylesheet. That is,
this will work:

  stylesheet A

  a, em {
    text-decoration: underline;
  }

  stylesheet B

  :root {
    text-decoration-position: below;
  }

because stylesheet B doesn't need to know the elements the underline
applies to, while in your proposal, stylesheet B has to be

  stylesheet B

  a, em {
    text-decoration: underline-below;
  }

This might be particularly important for vertical Japanese/Chinese
(which has underline on right/left). See the Default UA Stylesheet[1].


(12/07/19 14:33), Lutz Issler wrote:
> Apologies if there have been proposals for similar properties in the
> past.

Yeah, these have been proposed in the past and I had yet another syntax
bikeshedding proposal[2].

[1] http://dev.w3.org/csswg/css3-text/#default-stylesheet
[2] http://lists.w3.org/Archives/Public/www-style/2012Jan/0506


Cheers,
Kenny
-- 
Web Specialist, Oupeng Browser, Beijing
Received on Thursday, 9 August 2012 15:43:41 GMT

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