postcss-selector-matches

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

MIT 17 个版本
安装
npm install postcss-selector-matches
yarn add postcss-selector-matches
pnpm add postcss-selector-matches
bun add postcss-selector-matches
README

postcss-selector-matches CSS Standard Status Build Status

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

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

Installation

$ npm install postcss-selector-matches

Usage

var postcss = require("postcss")

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

Using this input.css:

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

you will get:

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

License

版本列表
4.0.0 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
1.0.1 2015-04-30
1.0.0 2015-04-30