Re: [css-text-decor-3] determining position and thickness of line decorations

Sorry to bring up this old thread from March 24th, 2013, but it got no replies and I think it raises an important issue.
Authors need fine grained control over text decorations and they will resort to any hack [1] to get it. In [1], the author explains how they tried everything, from borders to box-shadows, and ended up using gradient backgrounds (!), just to be able to control the color *and thickness* of text underlines.
IMO there should be a 4th property in the `text-decoration` shorthand: `text-decoration-width` or `text-decoration-thickness`, with values of auto | <length>.
`auto` would produce the current behavior and would be the initial value.

~Lea

[1]: https://medium.com/designing-medium/crafting-link-underlines-on-medium-7c03a9274f9

L. David Baron <dbaron@dbaron.org>  wrote:
> http://dev.w3.org/csswg/css-text-decor-3/#line-position
>  specifies
> the following for determining the thickness of decorations:
> 
>   # CSS does not define the thickness of line decorations. In
>   # determining the thickness of text decoration lines, user agents
>   # may consider the font sizes, faces, and weights of descendants
>   # to provide an appropriately averaged thickness. 
> 
> I think this "may consider" is a bad suggestion, and I would prefer
> that CSS specify that descendants do not affect the thickness.
> 
> I think this attempt to determine a useful underline for a single
> element is more likely to be harmful than helpful because it will
> lead to underlines being inconsistent between elements.  And I
> believe consistency of underlines between different underlined
> elements is important in many designs.  For example, if one item
> within a list (horizontal or vertical) or links contains some
> superscripted text, I believe authors would expect it to have the
> same style of underline as the other links.
> 
> I'm also hesitant to break invariants that you get basically the
> same thing if you split a single inline into multiple inlines -- an
> invariant that I expect editing tools assume in a number of cases.
> 
> 
> I believe these same invariants apply to the rules for positioning,
> where the specification is substantially more complicated.  I
> disagree with the entire premise of the rules, which I think are, as
> with thickness, likely to lead (in the cases where the rules matter
> at all) to ransom-note style underlining, which I believe designers
> dislike.
> 
> While these rules improve certain complex cases, I belive they hurt
> more common cases, and they also add substantial complexity to the
> specification.
> 
> -David
> 
> -- 
> 𝄞   L. David Baron                         
> http://dbaron.org/
>    𝄂
> 𝄢   Mozilla                           
> http://www.mozilla.org/   𝄂
Lea Verou ✿ http://lea.verou.me ✿ @leaverou

Received on Friday, 4 July 2014 16:14:04 UTC