postcss/postcss-selector-matches

Name: postcss-selector-matches

Owner: PostCSS

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

Created: 2015-04-29 05:30:52.0

Updated: 2018-05-07 02:18:15.0

Pushed: 2017-09-20 17:35:07.0

Homepage: null

Size: 24

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

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
m install postcss-selector-matches
Usage
postcss = require("postcss")

output = postcss()
se(require("postcss-selector-matches"))
rocess(require("fs").readFileSync("input.css", "utf8"))
ss

Using this input.css:

tches(:first-child, .special) {
lor: red;

you will get:

rst-child, p.special {
lor: 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

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.