query-style
v3.0.0
Published
Lightweight computed style query engine
Downloads
7
Readme
queryStyle
Lightweight computed style query engine.
Install
There are several ways to get a copy of query-style. Pick whichever one you like:
- Use it via UNPKG: https://unpkg.com/query-style/index.js. This is a simple way to embed it on a webpage without having to do any other setup.
- Install via NPM:
npm install --save query-style
- Install via YARN:
yarn add query-style
Require
import queryStyle from "query-style"
Documentation
Examples
All float: left nodes
const matches = queryStyle({
float: "left",
})
All float: left div
const matches = queryStyle(
{
float: "left",
},
document.querySelectorAll("div"),
)
Using function as criteria
All elements with a zIndex higher than 1000
const matches = queryStyle({
zIndex: (value) => value > 1000,
})