brandonaaron / jquery-cssHooks

Collection of cssHooks that work with jQuery 1.4.3+
Other
478 stars 80 forks source link

color intercepts textshadow's color #27

Open paulirish opened 13 years ago

paulirish commented 13 years ago

see testcase by chris coyier: http://jsbin.com/usalu5/edit

the textShadowColor hook in color.js overwrites the textShadowColor hook defined in textshadow.js

and apparently the color.js one doesnt work?

Regardless... there is some conflict here.

(the fix is to put textshadow.js after color.js in the source, but i think this still points to a bug .. )

louisremi commented 13 years ago

Thank you for reporting this issue Paul, I'm looking into it right now.

pdokas commented 13 years ago

textshadow.js relies on color.js (final line here):

            $.cssHooks[hook] = {
                get: function(elem, computed, extra) {
                    return (function(elem, pos, prop) {
                        var shadow = $.css(elem, propStr),
                            color = $.color.normalize(shadow),
                            ...

So color.js should be included before any other cssHook that relies on its normalization feature.

As for why it doesn't error when you include textshadow.js before color.js is a bit of a mystery to me at the moment. I'll look into more.