https://github.com/ghoullier/query-style
Lightweight computed style query engine.
https://github.com/ghoullier/query-style
computed-style query-engine
Last synced: 11 months ago
JSON representation
Lightweight computed style query engine.
- Host: GitHub
- URL: https://github.com/ghoullier/query-style
- Owner: ghoullier
- License: mit
- Created: 2015-06-30T15:47:35.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-04-30T19:16:28.000Z (almost 5 years ago)
- Last Synced: 2024-04-24T17:39:47.119Z (almost 2 years ago)
- Topics: computed-style, query-engine
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# queryStyle
[![NPM version][npm-version-image]][npm-url]
[![Gitter][gitter-image]][gitter-url]
[![Dependency Status][dependency-status-image]][dependency-status-url]
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
```js
import queryStyle from "query-style"
```
## Documentation
- [CHANGELOG](./CHANGELOG.md)
## Examples
All float: left nodes
```js
const matches = queryStyle({
float: "left",
})
```
All float: left div
```js
const matches = queryStyle(
{
float: "left",
},
document.querySelectorAll("div"),
)
```
Using function as criteria
All elements with a zIndex higher than 1000
```js
const matches = queryStyle({
zIndex: (value) => value > 1000,
})
```
[gitter-image]: https://badges.gitter.im/Join%20Chat.svg
[gitter-url]: https://gitter.im/ghoullier/query-style
[dependency-status-image]: http://img.shields.io/gemnasium/ghoullier/query-style.svg?style=flat
[dependency-status-url]: https://gemnasium.com/ghoullier/query-style
[npm-version-image]: http://img.shields.io/npm/v/query-style.svg?style=flat-square
[npm-url]: https://npmjs.org/package/query-style