GithubHelp home page GithubHelp logo

kassens / slick Goto Github PK

View Code? Open in Web Editor NEW

This project forked from subtlegradient/slick

1.0 3.0 1.0 1.87 MB

slick CSS selectors for javascript—now triple teh aswome

Home Page: http://projects.subtlegradient.com/sizzle/speed/

PHP 1.41% JavaScript 98.59%

slick's Introduction

MooTools Slick Selector Engine

A new standalone selector engine that is totally slick!

Create your own custom pseudo-classes!

Ever want to make your own :my-widget(rocks) pseudoclass? Now you can!

Use your own custom getAttribute code!

EG: Use MooTool's Element.get method or jQuery's $.attr

Use your own parser!

Want to support XPATH selectors? JSONPath selectors? Pre-cached JS Object selctors? Just swap out the default parser and make your own.

Use the parser by itself!

Want to integrate a CSS3 Selector parser into your own app somehow? Use the slick selector CSS3 parser by itself and get a JS Object representation of your selector.

MooTools Slick CSS Selector Parser

Parse a CSS selector string into a JavaScript object

Object format

{
	Slick: true,
	reverse: function(){},
	simple: false,
	length: 1,
	raw: "tag#id.class[attrib][attrib=attribvalue]:pseudo:pseudo(pseudovalue):not(pseudovalue)",
	expressions: [
		[
			{
				parts: [
					{ type: "class",                    value: "class", regexp: /regexp/ },
					{ type: "attribute", key: "attrib",                                      test: function(){} },
					{ type: "attribute", key: "attrib", value: "attribvalue", operator: "=", test: function(){} },
					{ type: "pseudo",    key: "pseudo" },
					{ type: "pseudo",    key: "pseudo", value: "pseudovalue" },
					{ type: "pseudo",    key: "not"   , value: "pseudovalue" }
				],
				tag: "tag",
				id: "id",
				classes: [
					"class"
				],
				attributes: [
					{ type: "attribute", key: "attrib", value: "",                           test: function(){} },
					{ type: "attribute", key: "attrib", value: "attribvalue", operator: "=", test: function(){} }
				],
				pseudos: [
					{ type: "pseudo", key: "pseudo" },
					{ type: "pseudo", key: "pseudo", value: "pseudovalue" },
					{ type: "pseudo", key: "not",    value: "pseudovalue" }
				],
				combinator: " "
			}
		]
	]
}

slick's People

Contributors

appden avatar chalkers avatar chuyeow avatar fabiomcosta avatar jeresig avatar kamicane avatar kassens avatar lostfx avatar subtlegradient avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.