0.0.19 • Published 3 years ago

images-sprite-generator v0.0.19

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

sprite-generator

You only need to specify the path where the images exists(png only), images-sprite-generator can help you to generate a stylesheet with sprite.

Usage

NPX

npx images-sprite-generator gen-sprite args...

Example(base64)

npx images-sprite-generator gen-sprite --src=./icons/ --cssOutput=./output.css
.sprite__{image name}
{
    width: 10px;
    height: 10px;
    background-position: -10px -10px;
}

...

.sprite {
    background-image: url(base64);
}

Example(create new png)

npx images-sprite-generator gen-sprite --src=./icons/ --cssOutput=./output.css --spriteOutput=./sprite.png
.sprite__{image name}
{
    width: 10px;
    height: 10px;
    background-position: -10px -10px;
}

...

.sprite {
    background-image: url(./sprite.png);
}

Example(HTML)

and then you can easily use sprite icon in your html.

<div class="sprite sprite__image-name"></div>

Options

argsdescriptiontypedefault
srcpath of images.(required)string-
paddingpadding of each imagesnumber10
spacesthe number of spaces for stylesheetnumber4
prefixprefix of class name for stylesheetstringsprite
cssOutputoutput path of stylesheetstringoutput.css
spriteOutputsprite png path, base64 mode if is emptystring-

TBD

0.0.19

3 years ago

0.0.18

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago