postcss-selector-parser

A CSS selector parser, integrates with postcss but does not require it.

MIT License

Downloads
148.8M
Stars
199
Committers
43

Bot releases are visible (Hide)

postcss-selector-parser - Release Candidate: 5.0.0

Published by chriseppstein over 6 years ago

Release Summary

  • The way a descendent combinator that isn't a single space character (E.g. .a .b) is stored in the AST has changed.
  • Named Combinators (E.g. .a /for/ .b) are now properly parsed as a combinator.
  • It is now possible to look up a node based on the source location of a character in that node and to query nodes if they contain some character.
  • Several bug fixes that caused the parser to hang and run out of memory when a / was encountered have been fixed.
  • The minimum supported version of Node is now v6.0.0.

CHANGELOG

postcss-selector-parser - Release Candidate: 4.0.0

Published by chriseppstein over 6 years ago

There were a number of bugs in the 3.x releases relating to how escape sequences were handled.

We took a step back and thought through these issues and decided that the best course was to change our public API in some subtle but important ways. The new API means that users don't have to worry about escape sequences anymore. By default, the selector parser always returns unescaped strings and then re-escapes them when converting back to CSS strings, using the originally authored escape sequences if possible. If you didn't handle escape sequences or deal with quoted values in attribute selectors, then this release is probably just fixing bugs that you didn't know you had.

If you are manipulating selectors with nonstandard CSS syntax, escape sequences, or special characters, this new API means your code is going to need to change.

There is a full writeup of the changes here: https://github.com/postcss/postcss-selector-parser/pull/133

postcss-selector-parser -

Published by ben-eb over 7 years ago

Breaking changes

  • Some tweaks to the tokenizer/attribute selector parsing mean that whitespace
    locations might be slightly different to the 2.x code.
  • Better attribute selector parsing with more validation; postcss-selector-parser
    no longer uses regular expressions to parse attribute selectors.
  • Added an async API (thanks to @jacobp100); the default process API is now
    async, and the sync API is now accessed through processSync instead.
  • Tweaks handling of Less interpolation (thanks to @jwilsson).
  • Removes support for Node 0.12.

Other changes

  • Set the parent when inserting a node (thanks to @chriseppstein).
  • Correctly adjust indices when using insertBefore/insertAfter (thanks to @tivac).
  • Fixes handling of namespaces with qualified tag selectors.
  • Now accepts a PostCSS rule node for better syntax errors.
  • Now more memory efficient when tokenizing selectors.