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

Add exclude argument to SpriteFactory config #48

Merged
merged 6 commits into from
Sep 9, 2015

Conversation

AlexanderRD
Copy link

Added an 'exclude' argument to the SpriteFactory class.

All image names within the target directory will be checked against the exclusion array, and images whose name match, or contain, elements from within the exclusion array will not be included in the sprite or stylesheet.

See tests for further details and for an example.

Use Cases:

  1. User wishes to generate a sprite that contains only a sub-set of the images contained within the target folder. The user makes use of the :exclude argument to exclude certain unused images from the generated sprite. The sprite generated is smaller in size, hopefully resulting in faster load times. Unused images can be left in the target folder until they are needed, but won't bloat the sprite.

  2. User wishes to create a sprite where the target folder matches the output folder. For instance the target folder is the Images/Icons folder, and the output target is Images/Icons/Icons.png. By using the :exclude => "Icons.png" argument future sf commands will not include the existing sprite in the newer sprite.

jakesgordon added a commit that referenced this pull request Sep 9, 2015
Add exclude argument to SpriteFactory config
@jakesgordon jakesgordon merged commit 3662be5 into jakesgordon:master Sep 9, 2015
@jakesgordon
Copy link
Owner

Thanks for the great PR - nice and clear and includes tests! Thanks.

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