Jeroen Coumans wrote:
On Jul 5, 9:56 pm, Scott Sauyet <[EMAIL PROTECTED]> wrote:
I don't want to discourage you from trying, but I think it's more
complicated than this.  Specificity has to do with the number of id's,
the number of classes (and pseudo-classes), and the number of elements
in the selector.  For instance,

Simple fix: provide a CSS file with the plugin which the author can
integrate themselves. Then selectors can be made as specific as
needed, and it would enable lots of CSS-savy designers with little
Javascript skills to customize the effects.

The problem is that the CSS and the JQuery selectors used are unique to users' sites or even pages. There is no clear way to make selectors that will have a higher specificity than every selector in the user's stylesheet. The advantage of how JQuery (and most all JS tools I've seen) apply styles is that they do it at the DOM level, which will override what's in any other stylesheets.

I think Gordon's suggestion of using "!important" is enough to make the difference, and Sean's implementation using that is already pretty strong. There is a ways to go towards making a generically useful plugin, but the proofs of concept are already quite impressive:

    http://www.sunsean.com/cssAnimate.html
    http://www.sunsean.com/animatetest.html

The thought of incorporating this into the core is intriguing, but I'm guessing it would be rather difficult, and it does run into the issue that other "!important" declarations would interfere. For now, I'd love to see a useful plugin that would allow us to use this where appropriate.

  -- Scott

Reply via email to