You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both rules .a .b and .a .be have the same specificity, so the h: i declaration should come at the very end in a new .a .b rule, based on the order in which declarations were originally defined (not how Sass does it, but more accurate).
The h: i declaration was given a semi-colon that it didn't previously have. This might be an issue with the structure of the AST raws, as the rule defines the semi-colon and not the declaration?
All rule indentation should be at the root of the document (definitely how Sass does it).
Sending the AST directly through postcss-nested doesn't completely unwrap the rules. I have to call the plugin multiple times to get complete unwrapping. If I have rules nested 4 levels deep, I have to call the plugin 4x!
For the last issue, this is what I was doing from within a custom plugin:
constnested=postcssNested();return(root,result)=>{// do stuffnested(root,result);};
Both rules .a .b and .a .be have the same specificity, so the h: i declaration should come at the very end in a new .a .b rule, based on the order in which declarations were originally defined (not how Sass does it, but more accurate).
Yeap, let’s fix it. Can you send PR, because I am working on another project right now?
The h: i declaration was given a semi-colon that it didn't previously have.
All rule indentation should be at the root of the document (definitely how Sass does it).
I decided that postcss-nested will not take care bout good formation. It is hard and most of the users will even not see this.
It could increase code 2x-3x times, especially if we will take care of all use cases.
Sending the AST directly through postcss-nested doesn't completely unwrap the rules. I have to call the plugin multiple times to get complete unwrapping. If I have rules nested 4 levels deep, I have to call the plugin 4x!
It is very strange because PostCSS itself does exactly the same nested(root, result) call.
Can you create a simple test stand to reproduce the issue?
I figured out that the culprit was my plugin when I converted at-rules into rules w/o using newRule.append. Turns out you also can't loop through container.nodes, which is what I was doing as well. Would love a generator method so I can do for (const node of rule.nodes()), because then I can continue and break and even yield if I wanted to.
I sent you an email with my phone number for when you come to Austin 😃
changed the title [-]Declarations in wrong order, extra semi, indentation, multiple passes[/-][+]Declarations in wrong specificity order[/+]on Jun 8, 2020
Activity
ai commentedon Jun 7, 2020
Yeap, let’s fix it. Can you send PR, because I am working on another project right now?
I decided that
postcss-nestedwill not take care bout good formation. It is hard and most of the users will even not see this.It could increase code 2x-3x times, especially if we will take care of all use cases.
It is very strange because PostCSS itself does exactly the same
nested(root, result)call.Can you create a simple test stand to reproduce the issue?
Nice to see you again =^_^=. I started to use TypeScript in some of my projects. Also, I am planning to visit Austin in August.
jednano commentedon Jun 8, 2020
newRule.append. Turns out you also can't loop throughcontainer.nodes, which is what I was doing as well. Would love a generator method so I can dofor (const node of rule.nodes()), because then I cancontinueandbreakand evenyieldif I wanted to.I sent you an email with my phone number for when you come to Austin 😃
[-]Declarations in wrong order, extra semi, indentation, multiple passes[/-][+]Declarations in wrong specificity order[/+]ai commentedon Jul 4, 2020
@jedmao I created a task https://cultofmartians.com/tasks/postcss-nested.html#task
jednano commentedon Jul 4, 2020
demikhovr commentedon Jul 4, 2020
Hi, I created PR #93
ai commentedon Jul 4, 2020
The fix by @demikhovr was released in 4.2.2
Keep declarations after nested rules inside at-rules (#180)