|
@ -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"]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
example/.sass-cache/
|
||||
example/output/sprite*
|
||||
node_modules/
|
||||
tmp_spritemaker*/
|
||||
bthlabs-sass-spritemaker-*.tgz
|
|
@ -0,0 +1,5 @@
|
|||
example/**/*
|
||||
test/**/*
|
||||
yarn.lock
|
||||
.eslintrc.json
|
||||
bthlabs-sass-spritemaker-*.tgz
|
|
@ -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.
|
|
@ -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/
|
|
@ -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 you’re 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.
|
|
@ -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/'
|
||||
});
|
Nachher Breite: | Höhe: | Größe: 1.2 KiB |
Nachher Breite: | Höhe: | Größe: 1.1 KiB |
Nachher Breite: | Höhe: | Größe: 824 B |
Nachher Breite: | Höhe: | Größe: 964 B |
Nachher Breite: | Höhe: | Größe: 741 B |
Nachher Breite: | Höhe: | Größe: 782 B |
Nachher Breite: | Höhe: | Größe: 952 B |
Nachher Breite: | Höhe: | Größe: 464 B |
Nachher Breite: | Höhe: | Größe: 368 B |
Nachher Breite: | Höhe: | Größe: 287 B |
Nachher Breite: | Höhe: | Größe: 367 B |
Nachher Breite: | Höhe: | Größe: 962 B |
Nachher Breite: | Höhe: | Größe: 274 B |
Nachher Breite: | Höhe: | Größe: 406 B |
Nachher Breite: | Höhe: | Größe: 389 B |
Nachher Breite: | Höhe: | Größe: 400 B |
Nachher Breite: | Höhe: | Größe: 462 B |
Nachher Breite: | Höhe: | Größe: 339 B |
Nachher Breite: | Höhe: | Größe: 1.1 KiB |
Nachher Breite: | Höhe: | Größe: 1.1 KiB |
Nachher Breite: | Höhe: | Größe: 413 B |
Nachher Breite: | Höhe: | Größe: 923 B |
Nachher Breite: | Höhe: | Größe: 543 B |
Nachher Breite: | Höhe: | Größe: 943 B |
Nachher Breite: | Höhe: | Größe: 963 B |
Nachher Breite: | Höhe: | Größe: 770 B |
Nachher Breite: | Höhe: | Größe: 1.1 KiB |
Nachher Breite: | Höhe: | Größe: 1.1 KiB |
Nachher Breite: | Höhe: | Größe: 625 B |
Nachher Breite: | Höhe: | Größe: 597 B |
Nachher Breite: | Höhe: | Größe: 262 B |
Nachher Breite: | Höhe: | Größe: 410 B |
Nachher Breite: | Höhe: | Größe: 821 B |
Nachher Breite: | Höhe: | Größe: 643 B |
Nachher Breite: | Höhe: | Größe: 892 B |
Nachher Breite: | Höhe: | Größe: 885 B |
Nachher Breite: | Höhe: | Größe: 368 B |
Nachher Breite: | Höhe: | Größe: 446 B |
Nachher Breite: | Höhe: | Größe: 425 B |
Nachher Breite: | Höhe: | Größe: 320 B |
Nachher Breite: | Höhe: | Größe: 385 B |
Nachher Breite: | Höhe: | Größe: 732 B |
Nachher Breite: | Höhe: | Größe: 1.0 KiB |
Nachher Breite: | Höhe: | Größe: 935 B |
Nachher Breite: | Höhe: | Größe: 895 B |
Nachher Breite: | Höhe: | Größe: 753 B |
Nachher Breite: | Höhe: | Größe: 650 B |
Nachher Breite: | Höhe: | Größe: 836 B |
Nachher Breite: | Höhe: | Größe: 961 B |
Nachher Breite: | Höhe: | Größe: 1.1 KiB |
Nachher Breite: | Höhe: | Größe: 1.2 KiB |
Nachher Breite: | Höhe: | Größe: 438 B |
Nachher Breite: | Höhe: | Größe: 824 B |
Nachher Breite: | Höhe: | Größe: 552 B |
Nachher Breite: | Höhe: | Größe: 731 B |
Nachher Breite: | Höhe: | Größe: 553 B |
Nachher Breite: | Höhe: | Größe: 304 B |
Nachher Breite: | Höhe: | Größe: 275 B |
Nachher Breite: | Höhe: | Größe: 921 B |
Nachher Breite: | Höhe: | Größe: 993 B |
Nachher Breite: | Höhe: | Größe: 843 B |
Nachher Breite: | Höhe: | Größe: 621 B |
Nachher Breite: | Höhe: | Größe: 627 B |
Nachher Breite: | Höhe: | Größe: 579 B |
Nachher Breite: | Höhe: | Größe: 816 B |
Nachher Breite: | Höhe: | Größe: 828 B |
Nachher Breite: | Höhe: | Größe: 845 B |
Nachher Breite: | Höhe: | Größe: 514 B |
Nachher Breite: | Höhe: | Größe: 530 B |
Nachher Breite: | Höhe: | Größe: 643 B |
Nachher Breite: | Höhe: | Größe: 664 B |
Nachher Breite: | Höhe: | Größe: 850 B |
Nachher Breite: | Höhe: | Größe: 577 B |
Nachher Breite: | Höhe: | Größe: 439 B |
Nachher Breite: | Höhe: | Größe: 440 B |
Nachher Breite: | Höhe: | Größe: 456 B |
Nachher Breite: | Höhe: | Größe: 492 B |
Nachher Breite: | Höhe: | Größe: 655 B |
Nachher Breite: | Höhe: | Größe: 286 B |
Nachher Breite: | Höhe: | Größe: 442 B |
Nachher Breite: | Höhe: | Größe: 414 B |
Nachher Breite: | Höhe: | Größe: 1014 B |
Nachher Breite: | Höhe: | Größe: 627 B |
Nachher Breite: | Höhe: | Größe: 548 B |
Nachher Breite: | Höhe: | Größe: 570 B |
Nachher Breite: | Höhe: | Größe: 711 B |
Nachher Breite: | Höhe: | Größe: 717 B |
Nachher Breite: | Höhe: | Größe: 656 B |
Nachher Breite: | Höhe: | Größe: 590 B |
Nachher Breite: | Höhe: | Größe: 301 B |
Nachher Breite: | Höhe: | Größe: 331 B |
Nachher Breite: | Höhe: | Größe: 325 B |
Nachher Breite: | Höhe: | Größe: 1010 B |