1
0
Atdalīts 0

Hello, sass-spritemaker!

master v1.0.0
Tomek Wójcik 2019-01-10 08:07:53 +01:00
revīzija fc60ab110d
151 mainītis faili ar 2530 papildinājumiem un 0 dzēšanām

52
.eslintrc.json Normal file
Parādīt failu

@ -0,0 +1,52 @@
{
"env": {
"node": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": true
}
},
"rules": {
"no-undef": "error",
"quotes": [
2, "single", {"avoidEscape": true, "allowTemplateLiterals": true}
],
"no-unused-vars": [0],
"no-console": [2],
"no-empty": ["error", {"allowEmptyCatch": true}],
"array-bracket-spacing": ["error", "never"],
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs", {"allowSingleLine": true}],
"camelcase": ["error", {"properties": "never"}],
"comma-dangle": ["error", "never"],
"comma-spacing": ["error", {"before": false, "after": true}],
"comma-style": ["error", "last"],
"computed-property-spacing": ["error", "never"],
"key-spacing": [
"error", {"beforeColon": false, "afterColon": true, "mode": "strict"}
],
"keyword-spacing": ["error", { "before": true, "after": true }],
"linebreak-style": ["error", "unix"],
"max-len": ["error", 120],
"no-multiple-empty-lines": ["error"],
"no-spaced-func": ["error"],
"no-trailing-spaces": ["error"],
"no-unreachable": [1],
"no-whitespace-before-property": ["error"],
"object-curly-spacing": ["error", "never"],
"one-var-declaration-per-line": ["error", "always"],
"one-var": ["error", "never"],
"semi-spacing": ["error", {"before": false, "after": true}],
"semi": ["error", "always"],
"space-before-function-paren": ["error", "always"],
"space-before-blocks": ["error", "always"],
"space-in-parens": ["error", "never"],
"space-infix-ops": ["error"],
"unicode-bom": ["error", "never"]
}
}

5
.gitignore ārējs Normal file
Parādīt failu

@ -0,0 +1,5 @@
example/.sass-cache/
example/output/sprite*
node_modules/
tmp_spritemaker*/
bthlabs-sass-spritemaker-*.tgz

5
.npmignore Normal file
Parādīt failu

@ -0,0 +1,5 @@
example/**/*
test/**/*
yarn.lock
.eslintrc.json
bthlabs-sass-spritemaker-*.tgz

19
LICENSE Normal file
Parādīt failu

@ -0,0 +1,19 @@
Copyright (c) 2019-present Tomek Wójcik <contact@bthlabs.pl>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

29
NOTICE.txt Normal file
Parādīt failu

@ -0,0 +1,29 @@
sass-spritemaker
Copyright (c) 2019-present Tomek Wójcik <contact@bthlabs.pl>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
---
sass-spritemaker includes the following third party software and resources
Linea Iconset
Copyright (c) Dario Ferrando
Licensed under terms of CCBY license
http://creativecommons.org/licenses/by/4.0/

67
README.md Normal file
Parādīt failu

@ -0,0 +1,67 @@
# sass-spritemaker
Convert a bunch of PNGs to a Sass spritemap.
## Installation
sass-spritemaker requires **Node 6.9.0 or later**.
```
npm install --save-dev @bthlabs/sass-spritemaker
```
This assumes that youre using [npm](http://npmjs.com/) package manager.
sass-spritemaker supports [yarn](https://yarnpkg.com/), too.
## Usage example
The following JavaScript code demonstrates the most common usage of the
library:
```javascript
const {spritemaker} = require('../lib/spritemaker.js');
spritemaker({
files: ['./icons/*.png'],
output: './output/'
});
```
## API
### `spritemaker(options)`
This is the main entrypoint of the library. The *options* argument is an object
that specifies the function's behaviour.
**Options object fields**:
* `fields` - array of globs that will be resolved to construct input files
list. Defaults to `[]`.
* `output` - path to output directory. Defaults to `sprite/`.
* `urlPrefix` - URL prefix for background image URLs. Defaults to `/`.
## Development
To bootstrap the development environment, clone the repo and run `npm install`
from the root directory.
The `package.json` file provides the following scripts:
* `lint` - performs an eslint run over the source code,
* `test` - performs a single test run.
## Contributing
If you think you found a bug or want to send a patch, feel free to contact
me through e-mail.
If you're sending a patch, make sure it passes eslint checks and is tested.
## Author
sass-spritemaker is developed by [Tomek Wójcik](https://www.bthlabs.pl/).
## License
sass-spritemaker is licensed under the MIT License.

28
example/example.js Normal file
Parādīt failu

@ -0,0 +1,28 @@
/**
* Copyright (c) 2019-present Tomek Wójcik <contact@bthlabs.pl>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
const {spritemaker} = require('../lib/spritemaker.js');
spritemaker({
files: ['./icons/*.png'],
output: './output/'
});

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 1.2 KiB

Binārs
example/icons/basic_alarm.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 1.1 KiB

Binārs
example/icons/basic_anchor.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 824 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 964 B

Binārs
example/icons/basic_archive.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 741 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 782 B

Binārs
example/icons/basic_ban.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 952 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 464 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 368 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 287 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 367 B

Binārs
example/icons/basic_bolt.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 962 B

Binārs
example/icons/basic_book.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 274 B

Binārs
example/icons/basic_book_pen.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 406 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 389 B

Binārs
example/icons/basic_bookmark.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 400 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 462 B

Binārs
example/icons/basic_calendar.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 339 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 1.1 KiB

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 1.1 KiB

Binārs
example/icons/basic_case.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 413 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 923 B

Binārs
example/icons/basic_clessidre.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 543 B

Binārs
example/icons/basic_clock.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 943 B

Binārs
example/icons/basic_clockwise.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 963 B

Binārs
example/icons/basic_cloud.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 770 B

Binārs
example/icons/basic_clubs.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 1.1 KiB

Binārs
example/icons/basic_compass.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 1.1 KiB

Binārs
example/icons/basic_cup.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 625 B

Binārs
example/icons/basic_diamonds.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 597 B

Binārs
example/icons/basic_display.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 262 B

Binārs
example/icons/basic_download.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 410 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 821 B

Binārs
example/icons/basic_eye.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 643 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 892 B

Binārs
example/icons/basic_female.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 885 B

Binārs
example/icons/basic_flag1.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 368 B

Binārs
example/icons/basic_flag2.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 446 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 425 B

Binārs
example/icons/basic_folder.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 320 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 385 B

Binārs
example/icons/basic_gear.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 732 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 1.0 KiB

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 935 B

Binārs
example/icons/basic_globe.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 895 B

Binārs
example/icons/basic_gunsight.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 753 B

Binārs
example/icons/basic_hammer.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 650 B

Binārs
example/icons/basic_headset.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 836 B

Binārs
example/icons/basic_heart.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 961 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 1.1 KiB

Binārs
example/icons/basic_helm.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 1.2 KiB

Binārs
example/icons/basic_home.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 438 B

Binārs
example/icons/basic_info.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 824 B

Binārs
example/icons/basic_ipod.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 552 B

Binārs
example/icons/basic_joypad.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 731 B

Binārs
example/icons/basic_key.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 553 B

Binārs
example/icons/basic_keyboard.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 304 B

Binārs
example/icons/basic_laptop.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 275 B

Binārs
example/icons/basic_life_buoy.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 921 B

Binārs
example/icons/basic_lightbulb.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 993 B

Binārs
example/icons/basic_link.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 843 B

Binārs
example/icons/basic_lock.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 621 B

Binārs
example/icons/basic_lock_open.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 627 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 579 B

Binārs
example/icons/basic_magnifier.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 816 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 828 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 845 B

Binārs
example/icons/basic_mail.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 514 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 530 B

Binārs
example/icons/basic_mail_open.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 643 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 664 B

Binārs
example/icons/basic_male.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 850 B

Binārs
example/icons/basic_map.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 577 B

Binārs
example/icons/basic_message.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 439 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 440 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 456 B

Binārs
example/icons/basic_mixer2.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 492 B

Binārs
example/icons/basic_mouse.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 655 B

Binārs
example/icons/basic_notebook.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 286 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 442 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 414 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 1014 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 627 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 548 B

Binārs
example/icons/basic_photo.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 570 B

Binārs
example/icons/basic_picture.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 711 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 717 B

Binārs
example/icons/basic_pin1.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 656 B

Binārs
example/icons/basic_pin2.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 590 B

Binārs
example/icons/basic_postcard.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 301 B

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 331 B

Binārs
example/icons/basic_printer.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 325 B

Binārs
example/icons/basic_question.png Normal file

Bināro failu nav iespējams attēlot.

Pēc

Platums:  |  Augstums:  |  Izmērs: 1010 B

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels Rādīt vairāk