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

W dniu 08.07.2014 19:36, Brad Kemper pisze:
> On Jul 4, 2014, at 9:12 AM, Lea Verou <lea@verou.me> wrote:
>> 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.
> I would love that. I usually prefer 1px underlines and strike-throughs, and think the larger lines look bad (except on very large type, sometimes), especially when anti-aliased due to not being even multiples of 1px. Others might get what they want by using ems.

It's OK.

But how could I have a red-wave-ish underscore with that? The one that 
indicates typeing errors in text editors these days?

Wouldn't it be imaginable to have a "text-decoration-image" instead, which:
1. has z-index "just a bit lower" then the text it "underscores", so 
that the underscore always renders above the background.
2. and is repeated as long as text-span reaches (i.e. across line breaks).

Then again, if such text-decoration-image could have an explicit z-index 
of its own (but relative to z-index of text, for ease of use), then it 
could also be used to overstrike text like "wobbling marker".

To get to the awsome underscors of medium.com, one then just needs 
text-shadow-blur to be limited in its reach downword by some additional 
z-index-max ... so that the underscore image gets text-shadow while the 
actual background doesn't.

In other words: it's almost the same as button having an img inside .... 
only different. So may be it's feasable after all?


-R

Received on Tuesday, 8 July 2014 20:58:39 UTC