Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

ryanmorr/is-selector-supported

Repository files navigation

isSelectorSupported

Version Badge Build Status License

Feature test CSS selector support

Install

Download the development or minified version, or install via NPM:

npm install @ryanmorr/is-selector-supported

Usage

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');

License

This project is dedicated to the public domain as described by the Unlicense.