3.0.0 • Published 3 years ago

query-style v3.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

queryStyle

NPM version Gitter Dependency Status

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,
})
3.0.0

3 years ago

2.0.0

8 years ago

1.0.0

9 years ago