css-calc.js 381 B

123456789101112
  1. // Method of allowing calculated values for length units, i.e. width: calc(100%-3em) http://caniuse.com/#search=calc
  2. // By @calvein
  3. Modernizr.addTest('csscalc', function() {
  4. var prop = 'width:';
  5. var value = 'calc(10px);';
  6. var el = document.createElement('div');
  7. el.style.cssText = prop + Modernizr._prefixes.join(value + prop);
  8. return !!el.style.length;
  9. });