Box-Sizing #248

Closed
limeblack opened this Issue Apr 27, 2011 · 1 comment

Projects

None yet

3 participants

@limeblack

Are there any plans to support box-sizing?

I believe it is as simple as;

  var s= ['boxSizing','MozBoxSizing','WebkitBoxSizing','msBoxSizing'];
  var div = document.createElement('div');
    for(var i=0,l=s.length;i<l ; i++){
     //obviously need to replace not override classes 
      if(div.style[s[i]]!=undefined)document.documentElement.className = 'box-sizing';
    } 
 })();

Or am I missing something?

@timmfin
timmfin commented May 4, 2011

I also ran into a need for this recently. I just added this (based on limeblack's code):

Modernizr.addTest('boxsizing', function () {
  var s = ['boxSizing', 'MozBoxSizing', 'WebkitBoxSizing', 'msBoxSizing'],
      div = document.createElement('div');

  for (var i = 0, l = s.length ; i < l ; i++) {
    if(div.style[s[i]] !=undefined)
      return true;
  } 

  return false;
});
@paulirish paulirish closed this in 3487408 May 21, 2011
@patrickkettner patrickkettner pushed a commit to patrickkettner/Modernizr that referenced this issue Feb 22, 2015
@paulirish paulirish box-sizing test. fixes #248 b1c4afa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment