2createStudio / postcss-sprites

Generate sprites from stylesheets.
MIT License
413 stars 50 forks source link

Add option to walk @-rules to cover Sass mixins #57

Closed niksy closed 8 years ago

niksy commented 8 years ago

Currently, plugin only walks through standard CSS selectors with walkRules, but using Sass you can define mixins with @mixin so you can define your sprite in one place and then reuse them at different places in your style codebase.

@mixin icon {
    background-image:url('icon.png');
}

Is it possible to add option to walk @-rules with walkAtRules, maybe through custom config property?

vvasilev- commented 8 years ago

@niksy, As far I understand the mixin is used to include the sprite dinamically into rules. Wouldn't it be easier to compile SASS and then pass the result to the plugin?

niksy commented 8 years ago

Yeah, when I think about it, that makes perfect sense. Closing this issue.