nDmitry / grunt-postcss

Apply several post-processors to your CSS using PostCSS.
MIT License
419 stars 57 forks source link

Using with grunt-sass, sourcemaps drill-down into mixins too far. #115

Open Jaace opened 7 years ago

Jaace commented 7 years ago

To elaborate, my setup is, roughly:

Now, if I leave postcss out of the equation, my source maps with grunt-sass look good. However, when I run it through postcss, my source maps look mostly ok, except where I'm using an @include mixin-name-here() as the first rule of a selector. In these cases, my post-css generated source map is drilling down all the way to the mixin name, which is not what I want.

E.g.: .some-element { @include a-cool-mixin(); other: rules; } This shows up as the mixin source in the source-map, so it would be like _cool-mixin.scss line 4 where that mixin is defined, instead of _layout.scss line 50, where the mixin was called.

Is there a way to stop postcss from drilling down into the mixin for the source map? I've tried many options in the setup, but cannot get this to work.