|
||||
---|---|---|---|---|
.. | ||||
dist | 11e3a9652a | лет %!s(int64=7): %!d(string=назад) | ||
API.md | 11e3a9652a | лет %!s(int64=7): %!d(string=назад) | ||
CHANGELOG.md | 11e3a9652a | лет %!s(int64=7): %!d(string=назад) | ||
LICENSE-MIT | 11e3a9652a | лет %!s(int64=7): %!d(string=назад) | ||
README.md | 11e3a9652a | лет %!s(int64=7): %!d(string=назад) | ||
package.json | 11e3a9652a | лет %!s(int64=7): %!d(string=назад) |
Selector parser with built in methods for working with selector strings.
With npm do:
npm install postcss-selector-parser
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
Please see API.md.
MIT