2.1.0 • Published 8 years ago

is-pseudo v2.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

js-standard-style

is Pseudo (?)

Provide a simple lookup to check if a provided selector targets a pseudo class or element.

About

Although there are already some projects which refer towards a list of pseudo classes or elements - they are not convenient to use for a simple lookup. On the contrary this library provides a simple validation function which also include browser vendor specific selectors and common extensions defined by jQuery & CSS Select.

Usage

Install

npm install --save is-pseudo

General

import isPseudo from 'is-pseudo'

if (isPseudo('div a.super:hover')) {
  // true
}

if (isPseudo('div span:has(a)', { customs: true })) {
  // true
}

TODO

  • add strict comparison option for selectors with brackets (e.g. :nth-child(3))

Links

Development

To build your own version run npm run dev for development (incl. watch) or npm run build for production (minified).

2.1.0

8 years ago

2.0.0

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago