jquery-cssHooks icon indicating copy to clipboard operation
jquery-cssHooks copied to clipboard

color intercepts textshadow's color

Open paulirish opened this issue 14 years ago • 2 comments

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 .. )

paulirish avatar Apr 21 '11 02:04 paulirish

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

louisremi avatar Apr 21 '11 09:04 louisremi

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.

pdokas avatar Apr 21 '11 20:04 pdokas