Skip to content
forked from mootools/slick

Standalone CSS Selector Parser and Engine. An official MooTools project.

Notifications You must be signed in to change notification settings

epitome-mvc/slicker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(Slick is an official MooTools project)

Slicker

Just the Slick parser for nodejs

Slick CSS Selector Parser

Parse a CSS selector string into a JavaScript object

Usage

.parse() selector into object

Parse a CSS Selector String into a Selector Object.

Expects: String

Returns: SelectorObject

var slicker = require('slick');

slicker.parse("#foo > bar.baz")  SelectorObject

SelectorObject format

slicker.parse('#foo > bar.baz');
{
	"raw":"#foo > bar.baz",
	"expressions": [[
		{ "combinator":" ", "tag":"*", "id":"foo" },
		{ "combinator":">", "tag":"bar", "classList": ["baz"], "classes": [{"value":"baz", "regexp":RegExp }]}
	]]
}

slicker.parse('h1, h2, ul > li, .things')
{
	"raw": "h1, h2, ul > li, .things",
	"expressions": [
		[{ "combinator":" ", "tag": "h1" }],
		[{ "combinator":" ", "tag": "h2" }],
		[{ "combinator":" ", "tag": "ul" }, { "combinator": ">", "tag": "li" }],
		[{ "combinator":" ", "tag": "*", "classList": ["things"], "classes": [{"value": "things", "regexp":RegExp }] }]
	]
}

About

Standalone CSS Selector Parser and Engine. An official MooTools project.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%