Skip to content

Custom at rules nesting issues #137

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

Merged
merged 2 commits into from
Jul 28, 2021

Conversation

bsak-shell
Copy link
Contributor

Fixes #136, and likely: #81, #124, #123.

let clone = rule.clone({ nodes: [] })
for (let child of children) {
clone.append(child)
function createFnAtruleChilds (bubble) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a wrapper - currying to have bubble available in the scope.

} else if (child.type === 'rule' && bubbling) {
child.selectors = selectors(rule, child)
} else if (child.type === 'atrule') {
if (child.nodes && bubble[child.name]) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only bubble if has children and actually should bubble, otherwise push as a "casual" child node.

@ai
Copy link
Member

ai commented Jul 27, 2021

Sorry, I have a busy week and this PR requires a lot of review (because of complex nature of transformation).

I will try to review it later.

Feel free to ping me again next week.

@bsak-shell
Copy link
Contributor Author

@ai Sure, thanks for reply :)

@ai ai merged commit 564b03f into postcss:main Jul 28, 2021
@bsak-shell bsak-shell deleted the custom-at-rules-nesting-issues branch July 30, 2021 08:37
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.

Nested custom at-rules issues
2 participants