mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-17 15:11:04 +00:00
34 lines
741 B
JavaScript
34 lines
741 B
JavaScript
/*!
|
|
{
|
|
"name": "CSS :target pseudo-class",
|
|
"caniuse": "css-sel3",
|
|
"property": "target",
|
|
"tags": ["css"],
|
|
"notes": [{
|
|
"name": "MDN Docs",
|
|
"href": "https://developer.mozilla.org/en-US/docs/Web/CSS/:target"
|
|
}],
|
|
"authors": ["@zachleat"],
|
|
"warnings": ["Opera Mini supports :target but doesn't update the hash for anchor links."]
|
|
}
|
|
!*/
|
|
/* DOC
|
|
Detects support for the ':target' CSS pseudo-class.
|
|
*/
|
|
define(['Modernizr'], function(Modernizr) {
|
|
// querySelector
|
|
Modernizr.addTest('target', function() {
|
|
var doc = window.document;
|
|
if (!('querySelectorAll' in doc)) {
|
|
return false;
|
|
}
|
|
|
|
try {
|
|
doc.querySelectorAll(':target');
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
});
|
|
});
|