├── .gitignore ├── LICENSE ├── README.md ├── app.yaml ├── bower.json ├── elements └── elements.html ├── gulpfile.js ├── index.html ├── package.json └── scripts └── deploy.sh /.gitignore: -------------------------------------------------------------------------------- 1 | bower_components 2 | dist 3 | node_modules 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Polymer Authors. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the names of its 14 | // contributors may be used to endorse or promote products derived from 15 | // this software without specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # polyicon 2 | 3 | A custom icon set generator from Polymers icon sets. Normally, you'd load an entire icon set 4 | even if you only use one of its icons in your app. This online tool makes it easy to create 5 | an optimized version with only the icons your ap needs. 6 | 7 | ### Try it 8 | 9 | 1. Visit https://poly-icon.appspot.com/ 10 | 2. Select the icons you want to use in your app 11 | 3. Download the optimized `` markup and create an HTML import for it 12 | 4. Load the import in your app and start using! 13 | 14 | For example, if your icon set name is "myicons" and the icon you want to use from that set is "hamburger", usage would look like: 15 | 16 | 17 | 18 | Boom! 19 | -------------------------------------------------------------------------------- /app.yaml: -------------------------------------------------------------------------------- 1 | runtime: python27 2 | api_version: 1 3 | threadsafe: yes 4 | 5 | handlers: 6 | 7 | - url: /$ 8 | static_files: index.html 9 | upload: index\.html 10 | secure: always 11 | 12 | - url: /(.*).(html|js|json|css) 13 | static_files: \1.\2 14 | upload: (.*)\.(html|js|json|css) 15 | secure: always 16 | 17 | skip_files: 18 | - ^(.*/)?#.*#$ 19 | - ^(.*/)?.*~$ 20 | - ^(.*/)?.*\.py[co]$ 21 | - ^(.*/)?.*/RCS/.*$ 22 | - ^(.*/)?\..*$ 23 | - gulpfile.js 24 | - (package|bower).json 25 | - test* 26 | - node_modules/(.*) 27 | - bower_components/[^/]+/bower_components/.*$ 28 | - bower_components/(.+/)+(test/|demo/|README|AUTHORS|CONTRIBUTING|PATENTS|Makefile) 29 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "iconset-generator", 3 | "description": "Generates a custom icon set", 4 | "version": "0.0.1", 5 | "main": "index.html", 6 | "author": "The Polymer Authors", 7 | "license": "BSD-3-Clause", 8 | "ignore": [ 9 | "**/.*", 10 | "node_modules", 11 | "bower_components", 12 | "test", 13 | "tests" 14 | ], 15 | "dependencies": { 16 | "iron-icon": "PolymerElements/iron-icon#^1.0.7", 17 | "iron-icons": "PolymerElements/iron-icons#^1.1.0", 18 | "iron-meta": "PolymerElements/iron-meta#^1.1.1", 19 | "iron-selector": "PolymerElements/iron-selector#^1.0.8", 20 | "paper-header-panel": "PolymerElements/paper-header-panel#^1.1.2", 21 | "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.6", 22 | "paper-input": "PolymerElements/paper-input#^1.1.3", 23 | "paper-styles": "PolymerElements/paper-styles#^1.1.1", 24 | "paper-toast": "PolymerElements/paper-toast#^1.1.1", 25 | "paper-toggle-button": "PolymerElements/paper-toggle-button#^1.0.12", 26 | "paper-toolbar": "PolymerElements/paper-toolbar#^1.1.2" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /elements/elements.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved. 3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 6 | Code distributed by Google as part of the polymer project is also 7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 8 | */ 9 | 10 | 'use strict'; 11 | 12 | let del = require('del'); 13 | let gulp = require('gulp'); 14 | let $ = require('gulp-load-plugins')(); 15 | let polyBuild = require('polybuild'); 16 | let merge = require('merge-stream'); 17 | let runSequence = require('run-sequence'); 18 | 19 | // function minifyHtml() { 20 | // return $.minifyHtml({quotes: true, empty: true, spare: true}); 21 | // } 22 | 23 | // function uglifyJS() { 24 | // return $.uglify({preserveComments: 'some'}); 25 | // } 26 | 27 | function polybuild() { 28 | return polyBuild({maximumCrush: true, suffix: ''}); 29 | } 30 | 31 | function license() { 32 | return $.license('BSD-3-Clause', { 33 | organization: 'The Polymer Project Authors. All rights reserved.', 34 | tiny: true 35 | }); 36 | } 37 | 38 | gulp.task('clean', function() { 39 | return del(['dist']); 40 | }); 41 | 42 | gulp.task('copy', function() { 43 | let docs = gulp.src(['*.html'], {base: '.'}) 44 | .pipe(gulp.dest('dist')); 45 | 46 | let gae = gulp.src([ 47 | //'{templates,lib,tests}/**/*' 48 | 'app.yaml' 49 | ]) 50 | .pipe(gulp.dest('dist')); 51 | 52 | let bower = gulp.src([ 53 | 'bower_components/webcomponentsjs/webcomponents-lite*.js' 54 | ], {base: '.'}) 55 | .pipe(gulp.dest('dist')); 56 | 57 | return merge(docs, gae, bower); 58 | }); 59 | 60 | gulp.task('vulcanize', function() { 61 | return gulp.src('elements/elements.html') 62 | // .pipe($.vulcanize({ 63 | // inlineScripts:true, 64 | // inlineCss: false, 65 | // stripComments: true 66 | // })) 67 | // .pipe($.crisper({scriptInHead: true})) 68 | // .pipe($.if('*.html', minifyHtml())) // Minify html output 69 | // .pipe($.if('*.js', uglifyJS())) // Minify js output 70 | .pipe(polybuild()) 71 | .pipe($.if('*.js', license())) 72 | .pipe(gulp.dest('dist/elements')); 73 | }); 74 | 75 | gulp.task('default', ['clean'], function(done) { 76 | runSequence(['vulcanize', 'copy'], done); 77 | }); 78 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Polymer Custom Iconset Generator 7 | 8 | 9 | 191 | 192 | 193 | 194 |
Not working? Try a browser with newer ES6 features.
195 | 196 | 248 | 249 | 257 | 258 | 259 | 445 | 446 | 447 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "iconset-generator", 3 | "version": "0.0.1", 4 | "description": "Make an HTML file with inline scripts CSP compliant", 5 | "main": "index.js", 6 | "bin": { 7 | "polyicon": "bin/polyicon" 8 | }, 9 | "scripts": { 10 | "postinstall": "bower install; gulp", 11 | "deploy": "scripts/deploy.sh", 12 | "serve": "dev_appserver.py app.yaml", 13 | "serve:dist": "dev_appserver.py dist/app.yaml" 14 | }, 15 | "author": "The Polymer Authors", 16 | "license": "BSD-3-Clause", 17 | "dependencies": { 18 | "command-line-args": "^2.1.3" 19 | }, 20 | "devDependencies": { 21 | "del": "^2.2.0", 22 | "gulp": "^3.9.0", 23 | "gulp-crisper": "^1.0.0", 24 | "gulp-if": "^2.0.0", 25 | "gulp-license": "^1.0.0", 26 | "gulp-load-plugins": "^1.1.0", 27 | "gulp-minify-html": "^1.0.4", 28 | "gulp-uglify": "^1.5.1", 29 | "gulp-vulcanize": "^6.1.0", 30 | "merge-stream": "^1.0.0", 31 | "polybuild": "^1.1.0", 32 | "run-sequence": "^1.1.5" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /scripts/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright (c) 2016 The Polymer Project Authors. All rights reserved. 4 | # This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | # The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | # The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | # Code distributed by Google as part of the polymer project is also 8 | # subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | 10 | deployVersion=$1 11 | 12 | if [ -z "$deployVersion" ] 13 | then 14 | echo "App version not specified." 15 | echo "Usage: npm run deploy 2016-01-01" 16 | exit 0 17 | fi 18 | 19 | readonly APPDIR=$(dirname $BASH_SOURCE) 20 | 21 | echo "\nBuilding app version: $deployVersion\n" 22 | gulp 23 | 24 | echo "Deploying app version: $deployVersion" 25 | #gcloud preview app deploy $APPDIR/../dist/app.yaml \ 26 | # --project poly-icon --version $deployVersion 27 | appcfg.py update dist/app.yaml -A poly-icon --version $deployVersion 28 | --------------------------------------------------------------------------------