Gaya / Retina-Sprites-for-Compass

Allow to use sprites in retina with Compass.
160 stars 31 forks source link

Add more flexibility, add build up icons enum #19

Closed RusinovAnton closed 7 years ago

RusinovAnton commented 7 years ago

Hey, I've customized you code for my own purposes and thought that it might be interesting for you.

Gaya commented 7 years ago

Thanks for this. How are you using this enum in your code? Just so I can paint a better understanding and write something in the docs to clarify.

RusinovAnton commented 7 years ago

@Gaya, ok. so lets say I want to include whole icon set from the icons/react-icons folder // style.scss

// I'm going to change icons folder path
$sprite-icons-folder: 'icons/react-icons/*.png';
$sprite-icons-2x-folder: 'icons/react-icons/*.png';
// and set custom icon prefix
$sprite-icons-class-prefix: 'react-icon_';

@import 'sprite/retina-sprites';
// so I need just import _sprite-icons-enum.scss file after _retina-sprites.scss
// and it will generate stylesheet with whole set of icons.
@import 'sprite/sprite-icons-enum';

Now when I add .png icons to the icons source folder and run styles build it will generate corresponding styles automatically.

Gaya commented 7 years ago

Thanks! I will merge this into the library. Great work!

RusinovAnton commented 7 years ago

@Gaya, are you going to bump bower package version? Also are you going to publish package on npm?

Gaya commented 7 years ago

Right. I'll do that later today. Thanks for the heads up

Gaya commented 7 years ago

Changes have been version bumped and module is also available on npm now