Skip to content

ghoullier/query-style

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Lightweight computed style query engine.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published