Lightweight computed style query engine.
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
import queryStyle from "query-style"
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,
})