npm.io
1.0.6 • Published 11 years ago

query-declaration

Licence
ISC
Version
1.0.6
Deps
0
Vulns
0
Weekly
0

queryDeclarationAll()

A pure-javascript CSS selector engine using CSS declarations for querying. Allowing the selection of elements by how they're styled.

Demo

Install Options

Build

git clone git@github.com:MikeCostello/query-declaration.git
npm install
npm install -g webpack
npm run build
Optional
npm run docs

Documentation

queryDeclarationAll(css [,context])

css
A CSS declaration block to match DOM Elements' computed styles against.
Type: String or PlainObject

context
The DOM Elements used when validating the CSS rules.
Type: CSS Selector String, DOM Element or Array of DOM Elements.
Default: "*"

jQuery Selector

$(":style(css)")

css
A CSS declaration block to match jQuery Elements' styles against.
Type: String or PlainObject

Examples
// Select red paragraphs
queryDeclarationAll({ color: "red" }, "p")

// Select images wider than 200px
queryDeclarationAll("{ width: >200px }", "img")

// Select images smaller than 100px using jQuery
$("img:style({ width: <100px })")

Keywords