tags:

views:

20

answers:

1

There are some css properties that can only(as far as I know) be modified as a set of values, like text-shadow (text-shadow:<xOffset> <yOffset> <radius> <color>;). I've seen some referred to as shorthand values, even though I've never seen the longer syntax version.

So, in a nutshell I'd like to modify individual parts of a declaration like in the example code below in an Fx.Morph transition without resorting to transition-specific hacks:

text-shadow:1px 1px 2px rgba(0,0,0,0.5)

Let's say I need to fade the shadow out. How would I accomplish that?

+1  A: 

Element.Styles.textShadow = "rgb(@, @, @) @px @px @px";

then just use like this.tween('text-shadow', '#000 10px 10px 30px'); - but you need to define a base shadow first i suppose. this seems to work: http://jsfiddle.net/6UADQ/

Dimitar Christoff
Wow, that worked. Thanks!
Pichan
From a quick search in the core source I can guess rgba is not yet supported. Am I correct?
Pichan
i can't say that i have tried but it would seem this way - i guess you can use morph on opacity in conjunction for the time being. i would ask this on the official mailing list - if it's an easy win, it may make 1.3.1, else, 2.0
Dimitar Christoff
According to the internets rgba should be supported in 2.0. Btw I stumbled upon some interesting features in mootools thanks to you. So I thank you once more :)
Pichan