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

Clone original background declaration #6

Merged
merged 1 commit into from Feb 1, 2017

Conversation

niksy
Copy link
Collaborator

@niksy niksy commented Feb 1, 2017

From PostCSS API docs:

If you create a node manually (e.g., with postcss.decl()), that node will not have a source property and will be absent from the source map. For this reason, the plugin developer should consider cloning nodes to create new ones (in which case the new node’s source will reference the original, cloned node) or setting the source property manually.

If there is no original source input file information, plugins like postcss-copy can’t copy file to new location and update declarations.

This has also benefit of referencing original declaration location in source file when you inspect retina images.

@simonsmith
Copy link
Owner

Thanks @niksy, a good catch

@simonsmith simonsmith merged commit b8042a3 into simonsmith:master Feb 1, 2017
@niksy
Copy link
Collaborator Author

niksy commented Feb 1, 2017

@simonsmith no problem! Any chance of having this fix pushed as new release? I’m currently using dedicated fork branch for this.

@simonsmith
Copy link
Owner

Yes, I'll do it very shortly

@simonsmith
Copy link
Owner

Published 2.0.1

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.

None yet

2 participants