-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Insertion plugin with tree #386
Conversation
Codecov Report
|
packages/emotion/src/index.js
Outdated
} | ||
|
||
function Node(id, selector, parent, ruleText) { | ||
this.id = id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is id
or parent
used here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, they were but not anymore.
@tkh44 The current AST plugin in the stylis repo could benefit from a lot of optimizations and improvements. For example this gist demos one that preserves nested children within the AST. Did you find any pain points that could be used to improve the stylis plugin system? I'm thinking of passing a depth argument to have data about what depth a rule in a nested selector is in. |
What:
Stylis processes styles from the inside out so we need to build some kind of structure to ensure proper insertion order of the rules.
See #384 for more details.
Why:
Nested pseudo selectors were breaking.
How:
Simple tree structure is used. The idea came from the stylis AST plugin.
Checklist:
closes #384