move hairline shim to bootstrap

This commit is contained in:
Tim Lancina
2015-08-11 10:28:40 -05:00
parent 5b30c79697
commit 63b1e79fd7
3 changed files with 17 additions and 24 deletions

View File

@@ -110,6 +110,22 @@ export class IonicApp {
}
});
/**
* Hairline Shim
* Add the "hairline" CSS class name to the body tag
* if the browser supports subpixels.
*/
if (window.devicePixelRatio >= 2) {
var hairlineEle = document.createElement('div');
hairlineEle.style.border = '.5px solid transparent';
document.body.appendChild(hairlineEle);
if (hairlineEle.offsetHeight === 1) {
document.body.classList.add('hairlines');
}
document.body.removeChild(hairlineEle);
}
bodyEle.setAttribute('mode', config.setting('mode'));
}