lepu-test-platform-web/node_modules/postcss-selector-parser
zhangbo db3ebd0df0 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
..
dist 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
API.md 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
CHANGELOG.md 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
LICENSE-MIT 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
README.md 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
package.json 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00

README.md

postcss-selector-parser Build Status

Selector parser with built in methods for working with selector strings.

Install

With npm do:

npm install postcss-selector-parser

Quick Start

var parser = require('postcss-selector-parser');
var transform = function (selectors) {
    selectors.eachInside(function (selector) {
        // do something with the selector
        console.log(String(selector))
    });
};

var transformed = parser(transform).process('h1, h2, h3').result;

To normalize selector whitespace:

var parser = require('postcss-selector-parser');
var normalized = parser().process('h1, h2, h3', {lossless:false}).result;
// -> h1,h2,h3

API

Please see API.md.

Credits

  • Huge thanks to Andrey Sitnik (@ai) for work on PostCSS which helped accelerate this module's development.

License

MIT