Last active
August 29, 2015 14:07
-
-
Save simonsmith/27d9090e2ec4bebfd585 to your computer and use it in GitHub Desktop.
Revisions
-
simonsmith revised this gist
Oct 6, 2014 . 2 changed files with 18 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ module.exports = withFeatureDetect; function withFeatureDetect() { 'use strict'; this.addFeatureDetectClass = function(feature, supported) { var prefix = (supported ? 'is-' : 'is-not-'); this.$node.addClass(prefix + feature + '-enabled'); }; this.after('initialize', function() { $.each(Modernizr, function(key, value) { if (Modernizr.hasOwnProperty(key)) { this.addFeatureDetectClass(key, value); } }.bind(this)); }); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +0,0 @@ -
simonsmith created this gist
Oct 6, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ module.exports = withModernizr; function withModernizr() { 'use strict'; this.attributes({ supportClass: 'is-{class}-supported' }); this.after('initialize', function() { $.each(Modernizr, function(key) { if (Modernizr.hasOwnProperty(key)) { this.$node.addClass(this.attr.supportClass.replace('{class}', key)); } }.bind(this)); }); }