A simple css sprite generator.
Project description
A simple css sprite generator.
Free software: BSD 2-Clause License
Installation
pip install css-sprite
You can also install the in-development version with:
pip install https://github.com/ionelmc/python-css-sprite/archive/main.zip
Usage
To generate a css sprite from images:
css-sprite [-h] [--grid GRID] --output OUTPUT [--mode MODE] [--vertical] [--background BACKGROUND] [--template TEMPLATE | --template-path TEMPLATE_PATH] [--verbose] [--version] image [image ...]
Output is mainly a new image but you can also generate the accompanying css.
- Positional arguments:
image Path to image to include in sprite.
- Options:
- -h, --help
show this help message and exit
- --grid GRID, -g GRID
Grid cell size to use. One of: auto, X:Y.
- --output OUTPUT, -o OUTPUT
Output file.
- --mode MODE, -m MODE
Force a certain image mode in the output, see: https://pillow.readthedocs.io/en/latest/handbook/concepts.html#modes.
- --vertical, -v
Stack the images vertically (they are stacked horizontally by default).
- --background BACKGROUND, -b BACKGROUND
Background color.
- --template TEMPLATE, -t TEMPLATE
Jinja template for CSS output on stdout.
- --template-path TEMPLATE_PATH, -p TEMPLATE_PATH
Jinja template path for CSS output on stdout.
- --verbose
Make output verbose.
- --version
show program’s version number and exit
Documentation
Development
To run all the tests run:
tox
Note, to combine the coverage data from all the tox environments run:
Windows |
set PYTEST_ADDOPTS=--cov-append tox |
---|---|
Other |
PYTEST_ADDOPTS=--cov-append tox |
Changelog
0.1.0 (2022-04-18)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for css_sprite-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b59ae27b68dc7ee963fbf4f75ef4eaa3600d5bca1ab0e440b0649dce8a9c781 |
|
MD5 | e2b9a8d84d5b41efe70329b0c4fc5c13 |
|
BLAKE2b-256 | 714f0d4e79af81cdf47645c679446759ea1d6ec091e9e90b71817d2a3ce7afcd |