Skip to content
This repository has been archived by the owner on Aug 6, 2019. It is now read-only.

Multi-value properties (text-shadow, box-shadow, etc) #21

Open
pdokas opened this issue Nov 15, 2010 · 2 comments
Open

Multi-value properties (text-shadow, box-shadow, etc) #21

pdokas opened this issue Nov 15, 2010 · 2 comments
Labels

Comments

@pdokas
Copy link
Collaborator

pdokas commented Nov 15, 2010

It would be good to support the CSS properties that can contain comma-separated values. A problem in doing so is that there's no defined name for these sub-values in the CSS specs. Names like textShadow0, textShadow1, … textShadowN seem reasonable enough. However, implementing them presents a significant architectural problem.

We'd need to populate $.cssHooks with each textShadowN value (and its subvalues, like textShadow3Color?) but obviously we can't just do that because N is unbounded. It seems like we need to dynamically create the necessary cssHook at the beginning of a get/set/animate call. I've studied the problem and it seems to require support from within jQuery itself but it's also seeming like going beyond reasonable scope.

Any thoughts? Is there need for this sort of thing? I mean, just imagine the fun that could be had on http://mothereffingtextshadow.com/ with such an ability ;)

@tomgrohl
Copy link
Collaborator

It would be good if someone wanted to changed say the third text shadow in a list of different text shadows.

Although certain browsers, like Opera, only allow a max of 6-9 text shadows. Safari 1 only supports one. It may be best to set a maximum yourself and test to see whether a browser supports 1 or multiple.

More info here (bottom of page): https://developer.mozilla.org/en/CSS/text-shadow

@pdokas
Copy link
Collaborator Author

pdokas commented Nov 15, 2010

Indeed. Safari only supported a single shadow until 4.0 as well. “Gecko (Firefox) theoretically supports infinite text-shadows (don't try it).” is a fun sentence.

The worry is that since there's no stated limit to number of shadows, in the spec or generally agreed-upon, we can't assume any specific cap. And without a cap there's no way to prepopulate all the necessary $.cssHooks values.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants