Download the PHP package jameslevi/sprite without Composer
On this page you can find all versions of the php package jameslevi/sprite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jameslevi/sprite
More information about jameslevi/sprite
Files in jameslevi/sprite
Package sprite
Short Description Is a simple image to sprite compiler tool for web development.
License MIT
Homepage https://github.com/jameslevi/sprite
Informations about the package sprite
Sprite
Is a simple image to sprite compiler tool for web development.
Features
- Supports png, gif, jpg, bmp and webp icons.
- Automatically generate css class for each icon.
- Easy integration with any web projects.
Installation
-
You can install via composer.
- Copy the atmos file from vendor/jameslevi/atmos folder to your root directory.
- Create a new folder in your root directory named commands.
Getting Started
-
Create a new atmos command file named "sprite".
-
Open the Sprite.php file from commands folder and add a new protected method named "generate".
-
Try the following code inside the generate method.
-
Run the following command in your terminal to generate sprite.
-
Add the generated css file in the head section of your project.
-
You can access each icon using css classes in this pattern sprite-{sprite name}-{icon name}.
- If there is a need to add new icons into your icon set, just run the generate command and it will generate new sprite image and stylesheet again.
Best Practices
- In each sprite set, always make sure all icons are of the same type and dimensions.
- Do not add spaces in naming icons, instead use hypen to separate words.
- Do not place your assets folder in public directory.
Contribution
For bug reports and suggestions, you can email James Levi Crisostomo via [email protected].
License
This package is an open-sourced software licensed under MIT License.