intersect-selectors
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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.

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

Readme

Keywords

Package Sidebar

Install

npm i intersect-selectors

Weekly Downloads

3

Version

0.0.3

License

MIT

Unpacked Size

42.3 kB

Total Files

6

Last publish

Collaborators

  • saiansh2525