New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Box-Sizing #248

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

Comments

Projects
None yet
3 participants
@limeb

limeb commented Apr 27, 2011

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

This comment has been minimized.

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 pushed a commit to patrickkettner/Modernizr that referenced this issue Feb 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment