项目作者: ryanmorr

项目描述 :
Feature test CSS selector support
高级语言: JavaScript
项目地址: git://github.com/ryanmorr/is-selector-supported.git
创建时间: 2015-05-02T21:22:30Z
项目社区:https://github.com/ryanmorr/is-selector-supported

开源协议:The Unlicense

下载


isSelectorSupported

Version Badge
Build Status
License

Feature test CSS selector support

Install

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

  1. npm install @ryanmorr/is-selector-supported

Usage

To use the method, simply provide a string of the CSS selector:

  1. import isSelectorSupported from '@ryanmorr/is-selector-supported';
  2. // Check if the :has() selector is supported
  3. isSelectorSupported(':has(img)');
  4. // Check if the case-insensitive attribute selectors are supported
  5. isSelectorSupported('[foo=bar i]');
  6. // Check if the ::backdrop pseudo-element selector is supported
  7. isSelectorSupported('::backdrop');

License

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