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

White space normalization in v4.0.0 #165

Closed
hail2u opened this issue Jan 10, 2015 · 2 comments
Closed

White space normalization in v4.0.0 #165

hail2u opened this issue Jan 10, 2015 · 2 comments
Labels

Comments

@hail2u
Copy link
Contributor

hail2u commented Jan 10, 2015

I'm updating dependencies in CSS MQPacker. However white space normalization in v4.0.0 looks very different to v3.x.x. Sometimes v4.0.0 removes after, sometimes removes between. Both expected results updated for passing test with v4.0.0.

I want to know what PostCSS v4.0.0 will and will not do to white spaces when moving nodes.

@ai
Copy link
Member

ai commented Jan 10, 2015

Remove:

  1. When you clone() node, PostCSS will remove all style properties (after, before, between).
  2. When you move node to other CSS root (by moveTo()), it will also remove all style properties.
  3. When you move node to same CSS root, it will remove only before and after.

Set new:

  1. When you insert node before some node, PostCSS will copy before from existed node to new one.
  2. When you try to stringify some node and it has no between, PostCSS willl try to find node with same type and copy between from this other node.
  3. When you try to stringify some node and it has no before or after, PostCSS will try to find what is indent that you use in your CSS by other nodes, which has before. Then PostCSS will calc current node depth and will calc before.
  4. If PostCSS can’t find other nodes to copy before, etc it will use default style properties.

@ai ai closed this as completed Jan 10, 2015
@ai ai added the question label Jan 10, 2015
@hail2u
Copy link
Contributor Author

hail2u commented Jan 11, 2015

Thanks! I'll try to let PostCSS sets new white spaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants