# postcss-selector-matches

> PostCSS plugin to transform :matches() W3C CSS pseudo class to more compatible CSS selectors

Latest version **4.0.0** (published 2018-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-selector-matches
pnpm add postcss-selector-matches
yarn add postcss-selector-matches
bun add postcss-selector-matches
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2018-09-18 |
| First published | 2015-04-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9.4 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 44 |
| Author | Maxime Thirouin |
| Maintainers | jonathantneal, moox, semigradsky |
| Keywords | postcss, postcss-plugin, selectors, selector, matches |

## Links

- npm: https://www.npmjs.com/package/postcss-selector-matches
- Repository: https://github.com/postcss/postcss-selector-matches
- Homepage: https://github.com/postcss/postcss-selector-matches#readme
- Issues: https://github.com/postcss/postcss-selector-matches/issues
- npm.io page: https://npm.io/package/postcss-selector-matches

## Dependencies (2)

- [postcss](https://npm.io/package/postcss.md) ^7.0.2
- [balanced-match](https://npm.io/package/balanced-match.md) ^1.0.0

## Recent versions

- 4.0.0 (latest) — 2018-09-18
- 3.0.1 — 2017-05-15
- 3.0.0 — 2017-05-11
- 2.0.5 — 2016-09-13
- 2.0.4 — 2016-09-06
- 2.0.3 — 2016-09-06
- 2.0.2 — 2016-09-06
- 2.0.1 — 2015-10-26
- 2.0.0 — 2015-08-25
- 1.2.1 — 2015-07-14
- 1.2.0 — 2015-07-14
- 1.1.2 — 2015-06-29
- 1.1.1 — 2015-06-17
- 1.1.0 — 2015-06-13
- 1.0.2 — 2015-06-13
- … 2 more at https://npm.io/package/postcss-selector-matches/versions

## README

# postcss-selector-matches [![CSS Standard Status](https://cssdb.org/badge/matches-pseudo-class.svg)](https://cssdb.org/#matches-pseudo-class) [![Build Status](https://travis-ci.org/postcss/postcss-selector-matches.svg?branch=master)](https://travis-ci.org/postcss/postcss-selector-matches)

> PostCSS plugin to transform `:matches()` W3C CSS pseudo class to more compatible CSS selectors

http://dev.w3.org/csswg/selectors-4/#matches

## Installation

```console
$ npm install postcss-selector-matches
```

## Usage

```js
var postcss = require("postcss")

var output = postcss()
  .use(require("postcss-selector-matches"))
  .process(require("fs").readFileSync("input.css", "utf8"))
  .css
```

Using this `input.css`:

```css
p:matches(:first-child, .special) {
  color: red;
}
```

you will get:

```css
p:first-child, p.special {
  color: red;
}
```

**Note that if you are doing crazy selector like `p:matches(a) {}` you are likely to get crazy results (like `pa {}`)**.


## Options

### `lineBreak`

(default: `false`)

Allows you to introduce a line break between generated selectors.

---

## [Changelog](CHANGELOG.md)

## [License](LICENSE)

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