Closed (fixed)
Project:
Modernizr
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Aug 2012 at 20:46 UTC
Updated:
20 Oct 2012 at 21:01 UTC
I need to test for browser support of the css text-shadow property. There is this polyfill available that does the job, but I cannot seem to get it to work in drupal + modernizr. The polyfill needs to test for Modernizr.textshadow and if there's no support, then load a .js and a .css file. Here's what I have in my theme.info:
modernizr[Modernizr.textshadow][nope][] = css/jquery.textshadow.css, js/jquery.textshadow.js
would this work, or do I need to do place each file in a separate test line? ...like so:
modernizr[Modernizr.textshadow][nope][] = css/jquery.textshadow.css
modernizr[Modernizr.textshadow][nope][] = js/jquery.textshadow.js
After I get an answer for this specific question, here's the final thing: how/where do I add this part:
$('h1').textshadow();
Thanx in advance.
Comments
Comment #1
ruplYou definitely need separate lines for each file. I do not think it's possible to comma-separate multiple files.
As for the callback: I have never tried to implement one from an .info file, so I would start by trying something like this:
The code may not handle the callback/complete functionality supported by the raw hook (look at the bottom of the 7.x-3.x API docs), so let me know how it works and we can tweak the API based on your findings.
Comment #2
ruplThey extended DrupalCon internet by two hours at the last second so I had time to test this and callback/complete are indeed broken :(
I added this line to
themey.infoon my local dev:Which produces the following Modernizr.load():
The declaration is fine but I need to work on the output. Changing status to reflect the nature of the issue. As always, thanks for the report!
Comment #3
ruplThis was committed to dev a while back but I forgot to update the issue. Fixed in the 7.x-3.0-beta2 release.
Comment #4.0
(not verified) commented...no leading forth-slashes ;)