Skip to content

Instantly share code, notes, and snippets.

@LeezQ
Last active December 18, 2018 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeezQ/639728831bd4a215e735683b55c7f74b to your computer and use it in GitHub Desktop.
Save LeezQ/639728831bd4a215e735683b55c7f74b to your computer and use it in GitHub Desktop.
1px
if (window.devicePixelRatio && devicePixelRatio >= 2) {
var testElem = document.createElement('div');
testElem.style.border = '.5px solid transparent';
document.body.appendChild(testElem);
if (testElem.offsetHeight == 1) {
document.documentElement.classList.add('hairlines');
}
document.body.removeChild(testElem);
}
html.hairlines a, html.hairlines div, html.hairlines dl, html.hairlines header, html.hairlines ul, html.hairlines li {
border-width: .5px!important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment