Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use css-tree to generate a proper CSS AST and use it for transformations #294

Merged
merged 2 commits into from
Feb 24, 2017

Conversation

Rich-Harris
Copy link
Member

This PR replaces the thicket of regex hacks used to transform CSS (for scoped styles) with a proper CSS parser, namely css-tree (which, after an exhaustive search, is the fastest parser and the one that generates the richest AST).

It fixes #288, and should prevent all sorts of other weird bugs from cropping up. It also paves the way for more intelligent transformations and analysis (e.g. warning on unused rules, omitting the descendant form of the transformed selector where possible, etc), but doesn't implement any of that yet.

@Rich-Harris Rich-Harris merged commit 47cd1d4 into master Feb 24, 2017
@Rich-Harris Rich-Harris deleted the css-parser branch February 24, 2017 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSS attribute substring selector not working with scoped styles
1 participant