UNPKG

modernizr

Version:

Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.

25 lines (24 loc) 869 B
/*! { "name": "CSS Generated Content", "property": "generatedcontent", "tags": ["css"], "warnings": ["Android won't return correct height for anything below 7px #738"], "notes": [{ "name": "W3C CSS Selectors Level 3 spec", "href": "https://www.w3.org/TR/css3-selectors/#gen-content" },{ "name": "MDN article on :before", "href": "https://developer.mozilla.org/en-US/docs/Web/CSS/::before" },{ "name": "MDN article on :after", "href": "https://developer.mozilla.org/en-US/docs/Web/CSS/::before" }] } !*/ define(['Modernizr', 'testStyles'], function(Modernizr, testStyles) { testStyles('#modernizr{font:0/0 a}#modernizr:after{content:":)";visibility:hidden;font:7px/1 a}', function(node) { // See bug report on why this value is 6 crbug.com/608142 Modernizr.addTest('generatedcontent', node.offsetHeight >= 6); }); });