hairline.js 739 B

123456789101112131415161718192021222324
  1. /*! {
  2. "name": "CSS Hairline",
  3. "property": "hairline",
  4. "tags": ["css"],
  5. "authors": ["strarsis"],
  6. "notes": [{
  7. "name": "Blog post about CSS retina hairlines",
  8. "href": "http://dieulot.net/css-retina-hairline"
  9. },{
  10. "name": "Derived from",
  11. "href": "https://gist.github.com/dieulot/520a49463f6058fbc8d1"
  12. }]
  13. }
  14. !*/
  15. /* DOC
  16. Detects support for hidpi/retina hairlines, which are CSS borders with less than 1px in width, for being physically 1px on hidpi screens.
  17. */
  18. define(['Modernizr', 'testStyles'], function(Modernizr, testStyles) {
  19. Modernizr.addTest('hairline', function() {
  20. return testStyles('#modernizr {border:.5px solid transparent}', function(elem) {
  21. return elem.offsetHeight === 1;
  22. });
  23. });
  24. });