Skip to content

A barebones toolkit for CSS selector parsing and matching.

License

Notifications You must be signed in to change notification settings

pulsar-edit/selector-kit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Selector Kit Build Status

Usage

{Selector} = require 'selector-kit'

# Creates one Selector
[someNodeSelector] = Selector.create('.some-node')

# Creates two selectors, due to the `,`
[someNodeSelector, anotherNodeSelector] = Selector.create('.some-node, .another-node')

someNodeSelector.matches('.parent .some-node') # => true
someNodeSelector.matches('.parent .whatever') # => false

anotherNodeSelector.matches('.parent .another-node') # => true
anotherNodeSelector.matches('.parent .whatever') # => false

# Other supported methods
someNodeSelector.toString() # => '.some-node'
someNodeSelector.getSpecificity() # => 20
someNodeSelector.compare(anotherNodeSelector) # => 0
someNodeSelector.isEqual(anotherNodeSelector) # false

💥

About

A barebones toolkit for CSS selector parsing and matching.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CoffeeScript 100.0%