# quolor

> Query based color styling

Latest version **0.2.0** (published 2024-01-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install quolor
pnpm add quolor
yarn add quolor
bun add quolor
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2024-01-30 |
| First published | 2024-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Author | 4mbl |
| Maintainers | 4mbl |
| Keywords | quolor, color, search-parameters, query-parameters, query-string, styling |

## Links

- npm: https://www.npmjs.com/package/quolor
- npm.io page: https://npm.io/package/quolor

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 0.2.0 (latest) — 2024-01-30
- 0.1.0 — 2024-01-30

## README

# Quolor

> A simple library to apply colors from the query string to the page.

## Usage

```ts
import { quolor } from 'quolor';

quolor(document);
```

### Custom Rules

```ts
import { quolor, Binding } from 'quolor';

const rules: Binding[] = [
  {
    type: 'text',
    css: '--query-color-text',
    query: 'color-text',
    elements: ['p', 'a'],
  },
  {
    type: 'background',
    css: '--query-color-bg',
    query: 'color-bg',
    specialElements: ['html'],
  },
];

quolor(document, rules);
```

## Default Rules

```ts
{
    type: 'text',
    css: '--query-color-text',
    query: 'color-text',
    elements: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'],
},
{
    type: 'background',
    css: '--query-color-bg',
    query: 'color-bg',
    specialElements: ['html'],
},
```

---
_Source: https://npm.io/package/quolor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
