Skip to content

Instantly share code, notes, and snippets.

@dieulot dieulot/hairlines.js
Last active Aug 29, 2015

What would you like to do? – CSS retina hairline, the easy way – JS
if (window.devicePixelRatio && devicePixelRatio >= 2) {
var testElem = document.createElement('div'); = '.5px solid transparent';
if (testElem.offsetHeight == 1)
// This assumes this script runs in <body>, if it runs in <head> wrap it in $(document).ready(function() { })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.