Permalink
Browse files

Merge pull request #542 from Calvein/master

Added `calc` test.
  • Loading branch information...
2 parents 065e91d + 4215172 commit 73360f86b903e3092da59adf65879cc3ad7445f2 @paulirish paulirish committed Mar 31, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 feature-detects/css-calc.js
@@ -0,0 +1,10 @@
+// Method of allowing calculated values for length units, i.e. width: calc(100%-3em) http://caniuse.com/#search=calc
+// By @calvein
+
+Modernizr.addTest('csscalc', function(el, prop, value) {
+ prop = 'width:';
+ value = 'calc(10px);';
+ el = document.createElement('div');
+ el.style.cssText = prop + Modernizr._prefixes.join(value + prop)
+ return !!el.style.length;
+});

0 comments on commit 73360f8

Please sign in to comment.