# intersect-selectors

> Finds the intersection of multiple CSS Selectors

Latest version **0.0.3** (published 2022-06-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install intersect-selectors
pnpm add intersect-selectors
yarn add intersect-selectors
bun add intersect-selectors
```

## 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.0.3 |
| Published | 2022-06-20 |
| First published | 2021-12-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 41.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Yash Singh |
| Maintainers | saiansh2525 |
| Keywords | intersect, css, selectors |

## Links

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

## Dependencies (3)

- [parsel-js](https://npm.io/package/parsel-js.md) ^1.0.2
- [group-array](https://npm.io/package/group-array.md) ^1.0.0
- [merge-array](https://npm.io/package/merge-array.md) ^1.0.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2022-06-20
- 0.0.2 — 2022-05-03
- 0.0.1 — 2021-12-01

## README

# `intersect-selectors`

Finds the most optimized intersection of any number of CSS Selectors.

## Usage

The function exported returns a string for the selector or an empty string if there is no intersection.

```js
const intersectSelectors = require('intersect-selectors');

intersectSelectors(
  'a + b:nth-child(4) > b',
  'b, c',
  "b:not([attr~='yo']) > b",
  'b',
  'd b'
);

// Result: d a ~ b:nth-child(4):not([attr~='yo']) > b
```

_NOTE: This program assumes that the CSS given matches the specification_

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