Following the lead of rupl and his work on the Modernizr module and Modernizr integration (see #1914478: [meta] Provide Modernizr integration for other contrib modules and #1735496: Geolocation Field: Integration with Modernizr 7.x-3.x), this is a request for @font-your-face integration with the Modernizr module.
As I understand it, the goal is to automate creation of custom Modernizr builds using hook_modernizr_info() which ensures that if @font-your-face is enabled, the Modernizr module knows it needs to include the @font-face feature test when fetching a custom build.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | fontyourface-modernizr-info-1946216-1.patch | 501 bytes | iwuv |
| #1 | fontyourface-modernizr-info-1946216-0.patch | 590 bytes | iwuv |
Comments
Comment #1
iwuv commentedPatch!
Comment #2
ruplHey, this is awesome! This patch is perfecto as far as matching the Modernizr 7.x-3.0 API. However, I've made some changes and 3.1 will be much easier and more stable for the future.
Could we make the following changes?
typeanddesclines. I put all that stuff into a master file within the Modernizr module.moduletosource(themes can supply tests so I made the term more generic)Here is an example from #1935794: Move support for Modernizr into HTML5 submodule
Comment #3
iwuv commentedThanks for the tip, @rupl! Here's a new patch to use instead of the first one. It works with the current Modernizr 7.x-3.x dev.
Comment #4
iwuv commentedChanging issue status to needs review.
Comment #5
sreynen commentedThis looks good to me, but I'll wait and see if rupl has any more feedback.
If it's not too late to give feedback on
hook_modernizr_info(), it seems odd to me that it's asking for the module name from a function that has the module machine name (which could be used to lookup the human name) as a prefix.Comment #6
ruplHey Scott, you're totally right about the redundancy and it has been pointed out to me by two others. I'm using associative arrays for metadata because there's other stuff I plan to add in the future (caniuse slugs, Modernizr docs links) and those do not correspond to any Drupal machine data.
Maybe just hold tight and I'll work out that kink and we can commit this afterwards. FWIW, this patch follows the exact convention in the Modernizr API docs, and when we switch to the more intelligent system of gathering module names later it will not break existing implementations.
Comment #7
ruplLatest dev of Modernizr 7.x-3.x now auto-detects which module/theme is asking for tests. So the syntax can be as simple as:
Thanks for the feedback, @sreynen
Comment #8
sreynen commentedThis is committed now.
Comment #9
ruplThanks dude!