RE: -webkit-background-clip:text and -webkit-text-fill-color?


[Brian Manthos:]
> 
> There's another use case that might be interesting as well.
> 
> Color can influence other *-color properties via currentColor.  As such,
> you can do things like...
>  div {
>   color: red;
>   border-color: currentColor;
>   box-shadow: 10px 10px 5px currentColor;
>  }
> 
> There are times when it would be nice to have this as well:
>  div {
>   color: teal;
>   border-color: currentColor;
>   background-color: currentColor;
>   text-color: blue;
>  }
> 
> With the introduction of text-color (with an initial value of
> currentColor), properties names such as text-image naturally come to mind.
> 
> Foreground-color, text-color... something like that.
> 
That's a solution, not a use-case. I can't tell why I wouldn't rather do:

  div {
   color: blue;
   border-color: teal;
   background-color: teal;
 }

If the requirement is 'define the teal color once and use it multiple times' then 
that is addressed by CSS Variables.

Received on Friday, 1 June 2012 04:52:30 UTC