Feature test CSS selector support
Feature test CSS selector support
Download the development or minified version, or install via NPM:
npm install @ryanmorr/is-selector-supported
To use the method, simply provide a string of the CSS selector:
import isSelectorSupported from '@ryanmorr/is-selector-supported';
// Check if the :has() selector is supported
isSelectorSupported(':has(img)');
// Check if the case-insensitive attribute selectors are supported
isSelectorSupported('[foo=bar i]');
// Check if the ::backdrop pseudo-element selector is supported
isSelectorSupported('::backdrop');
This project is dedicated to the public domain as described by the Unlicense.