cascornelissen / svg-spritemap-webpack-plugin

SVG spritemap plugin for webpack
MIT License
207 stars 49 forks source link

Allow custom naming of the generated LESS mixin #213

Closed sneaknz closed 4 months ago

sneaknz commented 4 months ago

For my output settings I have used a function to create custom prefixes via the sprite.prefix configuration option. This function generates ID names that include the parent folders, which means we can have multiple source SVGs with the same filename so long as they live in different folders. I was hoping to get the same naming used for the LESS variables that are created, and found sprite.prefixStylesSelectors but this seems to only work when using SCSS (unless I'm missing something?) Is there a way to specify/support this in the LESS output? EDIT: I found that this has already been fixed when installing from master πŸ‘

I'm also wanting to output two different SVG spritemaps, and it's my understanding that I should be able to just call SVGSpritemapPlugin twice in my webpack config to do this β€” however there doesn't seem to be a way to prefix/customise the name of the LESS mixin that is created, which defaults to .sprite() and means that one would override the other. Is this something that is achievable currently?

Thanks, I'm new to this plugin but really loving it so far!

sneaknz commented 4 months ago

Update: I've realised that the second part of this is not actually required, and have already worked out the first part. Thanks again :)