-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed commit of the following: commit 508b8934dc86d9fa22f563081f6dae2b9b0dcca0 Author: Stu Cox <stuart.cox@gmail.com> Date: Sun Mar 2 01:09:31 2014 +0000 Updated comments in `prefixedCSS` to explain that it accepts either camelCase or kebab-case commit 9ba6dfa96be800b1e668eac3978fb0c2494976d0 Author: Stu Cox <stuart.cox@gmail.com> Date: Sun Mar 2 01:01:56 2014 +0000 Removing duplicated/unused code and re-adding `cssToDOM()` (got lost in the rebase somewhere) commit 0062bd8ade4f4ef08359040f0e4e01424c004f5b Author: Stu Cox <stuart.cox@gmail.com> Date: Sun Mar 2 00:39:29 2014 +0000 Added tests for both camelCase and kebab-case inputs to Modernizr.prefixed and Modernizr.prefixedCSS commit 87e7271a954095c17c10c9029832f443b1f60285 Author: Stu Cox <stuart.cox@gmail.com> Date: Sat Mar 1 22:10:55 2014 +0000 `Moderizr.prefixed()` and `Modernizr.prefixedCSS()` now accept properties in camelCase OR kebab-case commit c1ccbc91c0e7837166d1677ab49c2ab2bffbef62 Author: Stu Cox <stuart.cox@gmail.com> Date: Sat Mar 1 21:40:35 2014 +0000 Changed `domToHyphenated` to `domToCSS` throughout the repo commit 560a929ce9efc954fafd20eebbf46412c62221ed Author: Stu Cox <stuart.cox@gmail.com> Date: Sun Dec 1 21:26:36 2013 +0000 Added tests for prefixedCSS() commit dc0d27170afef838218562286c3b350ae39469b1 Author: Stu Cox <stuart.cox@gmail.com> Date: Sun Dec 1 20:44:22 2013 +0000 Added comment to prefixed() re. prefixedCSS() commit 6e34fc143fea73200167c71588f89316b66475b4 Author: Stu Cox <stuart.cox@gmail.com> Date: Sun Dec 1 20:42:37 2013 +0000 Changed name of prefixedHyphenated to prefixedCSS commit fb9f494f51e769bccf5455956c4239a7774e60be Author: Stu Cox <stuart.cox@gmail.com> Date: Tue Jul 16 18:28:59 2013 +0100 Handled case of `prefixed()` returning false and added to `config-all.json` commit 7748702dfe4a5158ab970a84cbc6ae4a9e7459fd Author: Stu Cox <stuart.cox@gmail.com> Date: Tue Jul 16 18:11:49 2013 +0100 Added domToHyphenated dependency commit 74b5b9a5e476c41ddd1dc9fbb1363c3b3783b6a7 Author: Stu Cox <stuart.cox@gmail.com> Date: Tue Jul 16 17:57:35 2013 +0100 Added prefixedHyphenated function
- Loading branch information
Showing
7 changed files
with
108 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
define(function() { | ||
// Helper function for converting kebab-case to camelCase, | ||
// e.g. box-sizing -> boxSizing | ||
function cssToDOM( name ) { | ||
return name.replace(/([a-z])-([a-z])/g, function(str, m1, m2) { | ||
return m1 + m2.toUpperCase(); | ||
}).replace(/^-/, ''); | ||
} | ||
return cssToDOM; | ||
}); |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
define(function() { | ||
// Helper function for e.g. boxSizing -> box-sizing | ||
function domToHyphenated( name ) { | ||
// Helper function for converting camelCase to kebab-case, | ||
// e.g. boxSizing -> box-sizing | ||
function domToCSS( name ) { | ||
return name.replace(/([A-Z])/g, function(str, m1) { | ||
return '-' + m1.toLowerCase(); | ||
}).replace(/^ms-/, '-ms-'); | ||
} | ||
return domToHyphenated; | ||
return domToCSS; | ||
}); |
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
define(['ModernizrProto', 'prefixed', 'domToCSS'], function( ModernizrProto, prefixed, domToCSS ) { | ||
// Modernizr.prefixedCSS() is like Modernizr.prefixed(), but returns the result in | ||
// hyphenated form, e.g.: | ||
// Modernizr.prefixedCSS('transition') // '-moz-transition' | ||
|
||
// It’s only suitable for style properties. | ||
|
||
// Properties can be passed as DOM-style camelCase or CSS-style kebab-case. | ||
// Return values will always be the hyphenated variant, or `false` if not supported | ||
var prefixedCSS = ModernizrProto.prefixedCSS = function(prop) { | ||
var prefixedProp = prefixed(prop); | ||
return prefixedProp && domToCSS(prefixedProp); | ||
}; | ||
return prefixedCSS; | ||
}); |
This file contains 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 characters