Permalink
Browse files

Add test for CSS `:focus-within` pseudo-selector (#2287)

Fixes #2270
OliverJAsh authored and patrickkettner committed Feb 8, 2018
1 parent e6aafde commit d4f565133bbdc4371a06570770e43b5b30bb2a2c
Showing with 18 additions and 0 deletions.
  1. +18 −0 feature-detects/css/focuswithin.js
@@ -0,0 +1,18 @@
+/*!
+{
+ "name": "CSS :focus-within pseudo-selector",
+ "caniuse": "css-focus-visible",
+ "property": "focuswithin",
+ "tags": ["css"]
+}
+!*/
+define(['Modernizr'], function(Modernizr) {
+ Modernizr.addTest('focuswithin', function() {
+ try {
+ document.querySelector(':focus-within')
+ } catch (error) {
+ return false;
+ }
+ return true;
+ });
+});

0 comments on commit d4f5651

Please sign in to comment.