query-declaration
v1.0.6
Published
A pure-javascript CSS selector engine using CSS declarations for querying.
Downloads
12
Maintainers
Readme
queryDeclarationAll()
A pure-javascript CSS selector engine using CSS declarations for querying. Allowing the selection of elements by how they're styled.
Install Options
- Download query-declaration.js for use in
<script>
tag. - jQuery plugin jquery-selector-style.js
npm install query-declaration
bower install query-declaration
Build
git clone [email protected]: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 })")