tabler-icons
Advanced tools
Comparing version 1.1.0 to 1.2.0
173
gulpfile.js
@@ -9,2 +9,7 @@ const gulp = require('gulp'), | ||
puppeteer = require('puppeteer'), | ||
outlineStroke = require('svg-outline-stroke'), | ||
iconfont = require('gulp-iconfont'), | ||
template = require('lodash.template'), | ||
sass = require('node-sass'), | ||
cleanCSS = require('clean-css'), | ||
argv = require('minimist')(process.argv.slice(2)); | ||
@@ -75,16 +80,25 @@ | ||
const printChangelog = function (newIcons, modifiedIcons, renamedIcons) { | ||
const printChangelog = function (newIcons, modifiedIcons, renamedIcons, pretty = false) { | ||
if (newIcons.length > 0) { | ||
let str = ''; | ||
str += `${newIcons.length} new icons: `; | ||
if (pretty) { | ||
console.log(`### ${newIcons.length} new icons:`); | ||
newIcons.forEach(function (icon, i) { | ||
str += `\`${icon}\``; | ||
newIcons.forEach(function (icon, i) { | ||
console.log(`- \`${icon}\``); | ||
}); | ||
} else { | ||
let str = ''; | ||
str += `${newIcons.length} new icons: `; | ||
if ((i + 1) <= newIcons.length - 1) { | ||
str += ', ' | ||
} | ||
}); | ||
newIcons.forEach(function (icon, i) { | ||
str += `\`${icon}\``; | ||
console.log(str); | ||
if ((i + 1) <= newIcons.length - 1) { | ||
str += ', ' | ||
} | ||
}); | ||
console.log(str); | ||
} | ||
console.log(''); | ||
@@ -118,6 +132,5 @@ } | ||
const generateIconsPreview = function(files, destFile, cb, columnsCount = 17) { | ||
const generateIconsPreview = function (files, destFile, cb, columnsCount = 17, paddingOuter = 5) { | ||
const padding = 29, | ||
paddingOuter = 5, | ||
iconSize = 24; | ||
@@ -168,6 +181,126 @@ | ||
gulp.task('iconfont-prepare', function (cb) { | ||
cp.exec('mkdir -p icons-outlined/ && rm -fd ./icons-outlined/* && mkdir -p && rm -fd ./iconfont/*', function () { | ||
cb(); | ||
}); | ||
}); | ||
gulp.task('iconfont-clean', function (cb) { | ||
cp.exec('rm -rf ./icons-outlined', function () { | ||
cb(); | ||
}); | ||
}); | ||
gulp.task('iconfont-svg-outline', function (cb) { | ||
cp.exec('mkdir -p icons-outlined/ && rm -fd ./icons-outlined/*', async () => { | ||
let files = glob.sync("./icons/*.svg"); | ||
let iconfontUnicode = {}; | ||
if(fs.existsSync('./iconfont-unicode.json')) { | ||
iconfontUnicode = require('./iconfont-unicode'); | ||
} | ||
await asyncForEach(files, async function (file) { | ||
const name = path.basename(file, '.svg'), | ||
unicode = iconfontUnicode[name]; | ||
await console.log('Stroke for:', file, unicode); | ||
let strokedSVG = fs.readFileSync(file).toString(); | ||
strokedSVG = strokedSVG | ||
.replace('width="24"', 'width="1000"') | ||
.replace('height="24"', 'height="1000"'); | ||
await outlineStroke(strokedSVG, { | ||
optCurve: false, | ||
steps: 4, | ||
round: 0, | ||
centerHorizontally: true, | ||
fixedWidth: true, | ||
color: 'black' | ||
}).then(outlined => { | ||
if(unicode) { | ||
fs.writeFileSync(`icons-outlined/u${unicode.toUpperCase()}-${name}.svg`, outlined); | ||
} else { | ||
fs.writeFileSync(`icons-outlined/${name}.svg`, outlined); | ||
} | ||
}).catch(error => console.log(error)); | ||
}); | ||
cb(); | ||
}); | ||
}); | ||
gulp.task('iconfont', function () { | ||
let maxUnicode = 59905; | ||
if(fs.existsSync('./iconfont-unicode.json')) { | ||
const iconfontUnicode = require('./iconfont-unicode'); | ||
for(const name in iconfontUnicode) { | ||
const unicode = parseInt(iconfontUnicode[name], 16); | ||
maxUnicode = Math.max(maxUnicode, unicode); | ||
} | ||
} | ||
return gulp.src(['icons-outlined/*.svg']) | ||
.pipe(iconfont({ | ||
fontName: 'tabler-icons', | ||
prependUnicode: true, | ||
formats: ['ttf', 'eot', 'woff', 'woff2'], | ||
normalize: true, | ||
startUnicode: maxUnicode | ||
})) | ||
.on('glyphs', function (glyphs, options) { | ||
//glyphs json | ||
let glyphsObject = {}; | ||
glyphs.forEach(function (glyph) { | ||
glyphsObject[glyph.name] = glyph.unicode[0].codePointAt(0).toString(16); | ||
}); | ||
fs.writeFileSync(`iconfont-unicode.json`, JSON.stringify(glyphsObject)); | ||
//css | ||
options['glyphs'] = glyphs; | ||
options['v'] = p.version; | ||
const compiled = template(fs.readFileSync('.build/iconfont.scss').toString()); | ||
const result = compiled(options); | ||
fs.writeFileSync('iconfont/tabler-icons.scss', result); | ||
//html | ||
const compiledHtml = template(fs.readFileSync('.build/iconfont.html').toString()); | ||
const resultHtml = compiledHtml(options); | ||
fs.writeFileSync('iconfont/tabler-icons.html', resultHtml); | ||
}) | ||
.pipe(gulp.dest('iconfont/fonts')); | ||
}); | ||
gulp.task('iconfont-css', function (cb) { | ||
sass.render({ | ||
file: 'iconfont/tabler-icons.scss', | ||
outputStyle: 'expanded' | ||
}, function (err, result) { | ||
fs.writeFileSync('iconfont/tabler-icons.css', result.css); | ||
const cleanOutput = new cleanCSS({}).minify(result.css); | ||
fs.writeFileSync('iconfont/tabler-icons.min.css', cleanOutput.styles); | ||
cb(); | ||
}); | ||
}); | ||
gulp.task('build-iconfont', gulp.series('iconfont-prepare', 'iconfont-svg-outline', 'iconfont', 'iconfont-css', 'iconfont-clean')); | ||
gulp.task('build-zip', function () { | ||
const version = p.version; | ||
return gulp.src('{icons/**/*,icons-png/**/*,tabler-sprite.svg,tabler-sprite-nostroke.svg}') | ||
return gulp.src('{icons/**/*,icons-png/**/*,iconfont/**/*,tabler-sprite.svg,tabler-sprite-nostroke.svg}') | ||
.pipe(zip(`tabler-icons-${version}.zip`)) | ||
@@ -318,3 +451,3 @@ .pipe(gulp.dest('packages')) | ||
if(version) { | ||
if (version) { | ||
cp.exec(`git diff ${version} HEAD --name-status`, function (err, ret) { | ||
@@ -340,3 +473,3 @@ | ||
printChangelog(newIcons, modifiedIcons, renamedIcons); | ||
printChangelog(newIcons, modifiedIcons, renamedIcons, true); | ||
@@ -352,3 +485,3 @@ cb(); | ||
if(version) { | ||
if (version) { | ||
cp.exec(`git diff v${version} HEAD --name-status`, function (err, ret) { | ||
@@ -362,8 +495,8 @@ | ||
newIcons = newIcons.map(function(icon){ | ||
newIcons = newIcons.map(function (icon) { | ||
return `./icons/${icon}.svg`; | ||
}); | ||
if(newIcons.length > 0) { | ||
generateIconsPreview(newIcons, `packages/tabler-icons-${newVersion}.svg`, cb, 6); | ||
if (newIcons.length > 0) { | ||
generateIconsPreview(newIcons, `.github/tabler-icons-${newVersion}.svg`, cb, 6, 24); | ||
} else { | ||
@@ -393,2 +526,2 @@ cb(); | ||
gulp.task('build', gulp.series('optimize', 'build-jekyll', 'build-copy', 'icons-sprite', 'icons-preview', 'svg-to-png', 'changelog-image', 'build-zip')); | ||
gulp.task('build', gulp.series('optimize', 'build-jekyll', 'build-copy', 'icons-sprite', 'icons-preview', 'svg-to-png', /*'build-iconfont', */ 'changelog-image', 'build-zip')); |
{ | ||
"name": "tabler-icons", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"repository": { | ||
@@ -20,2 +20,3 @@ "type": "git", | ||
"icons-png/*", | ||
"iconfont/*", | ||
"tabler-sprite.svg", | ||
@@ -28,2 +29,3 @@ "tabler-sprite-nostroke.svg" | ||
"start": "bundle exec jekyll serve --watch --livereload", | ||
"optimize": "gulp optimize", | ||
"release": "release-it" | ||
@@ -33,8 +35,11 @@ }, | ||
"devDependencies": { | ||
"clean-css": "4.2.3", | ||
"glob": "7.1.6", | ||
"gulp": "4.0.2", | ||
"gulp-iconfont": "10.0.3", | ||
"gulp-zip": "5.0.1", | ||
"minimist": "1.2.5", | ||
"puppeteer": "2.1.1", | ||
"release-it": "13.1.2" | ||
"release-it": "13.1.2", | ||
"svg-outline-stroke": "1.2.4" | ||
}, | ||
@@ -55,3 +60,7 @@ "release-it": { | ||
} | ||
}, | ||
"dependencies": { | ||
"lodash.template": "^4.5.0", | ||
"node-sass": "^4.13.1" | ||
} | ||
} |
# Tabler Icons | ||
A set of over 300 free MIT-licensed high-quality SVG icons for you to use in your web projects. Each icon is designed on a 24x24 grid and a `2px` stroke. | ||
A set of over 350 free MIT-licensed high-quality SVG icons for you to use in your web projects. Each icon is designed on a 24x24 grid and a `2px` stroke. | ||
**If you want to support my project and help me grow it, you can [become a sponsor on GitHub](https://github.com/sponsors/codecalm) or just [donate me on PayPal](https://paypal.me/codecalm) :)** | ||
**If you want to support my project and help me grow it, you can [become a sponsor on GitHub](https://github.com/sponsors/codecalm) or just [donate on PayPal](https://paypal.me/codecalm) :)** | ||
@@ -7,0 +7,0 @@ ## Preview |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2166771
762
1451
2
9
2
+ Addedlodash.template@^4.5.0
+ Addednode-sass@^4.13.1
+ Addedabbrev@1.1.1(transitive)
+ Addedajv@6.12.6(transitive)
+ Addedamdefine@1.0.1(transitive)
+ Addedansi-regex@2.1.14.1.1(transitive)
+ Addedansi-styles@2.2.13.2.1(transitive)
+ Addedaproba@1.2.0(transitive)
+ Addedare-we-there-yet@1.1.7(transitive)
+ Addedarray-find-index@1.0.2(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasync-foreach@0.1.3(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedblock-stream@0.0.9(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedcamelcase@2.1.15.3.1(transitive)
+ Addedcamelcase-keys@2.1.0(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedchalk@1.1.3(transitive)
+ Addedcliui@5.0.0(transitive)
+ Addedcode-point-at@1.1.0(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconsole-control-strings@1.1.0(transitive)
+ Addedcore-util-is@1.0.21.0.3(transitive)
+ Addedcross-spawn@3.0.1(transitive)
+ Addedcurrently-unhandled@0.4.1(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddelegates@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedemoji-regex@7.0.3(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedfind-up@1.1.23.0.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedfstream@1.0.12(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedgauge@2.7.4(transitive)
+ Addedgaze@1.1.3(transitive)
+ Addedget-caller-file@2.0.5(transitive)
+ Addedget-stdin@4.0.1(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedglob@7.1.77.2.3(transitive)
+ Addedglobule@1.3.4(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhas-ansi@2.0.0(transitive)
+ Addedhas-unicode@2.0.1(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhosted-git-info@2.8.9(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedin-publish@2.0.1(transitive)
+ Addedindent-string@2.1.0(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedis-finite@1.1.0(transitive)
+ Addedis-fullwidth-code-point@1.0.02.0.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedis-utf8@0.2.1(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjs-base64@2.6.4(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedload-json-file@1.1.0(transitive)
+ Addedlocate-path@3.0.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedlodash._reinterpolate@3.0.0(transitive)
+ Addedlodash.template@4.5.0(transitive)
+ Addedlodash.templatesettings@4.2.0(transitive)
+ Addedloud-rejection@1.6.0(transitive)
+ Addedlru-cache@4.1.5(transitive)
+ Addedmap-obj@1.0.1(transitive)
+ Addedmeow@3.7.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedminimatch@3.0.83.1.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addednan@2.22.0(transitive)
+ Addednode-gyp@3.8.0(transitive)
+ Addednode-sass@4.14.1(transitive)
+ Addednopt@3.0.6(transitive)
+ Addednormalize-package-data@2.5.0(transitive)
+ Addednpmlog@4.1.2(transitive)
+ Addednumber-is-nan@1.0.1(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedos-homedir@1.0.2(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedosenv@0.1.5(transitive)
+ Addedp-limit@2.3.0(transitive)
+ Addedp-locate@3.0.0(transitive)
+ Addedp-try@2.2.0(transitive)
+ Addedparse-json@2.2.0(transitive)
+ Addedpath-exists@2.1.03.0.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-type@1.1.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpify@2.3.0(transitive)
+ Addedpinkie@2.0.4(transitive)
+ Addedpinkie-promise@2.0.1(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedpseudomap@1.0.2(transitive)
+ Addedpsl@1.13.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedread-pkg@1.1.0(transitive)
+ Addedread-pkg-up@1.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedredent@1.0.0(transitive)
+ Addedrepeating@2.0.1(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedrequire-directory@2.1.1(transitive)
+ Addedrequire-main-filename@2.0.0(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedrimraf@2.7.1(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsass-graph@2.2.5(transitive)
+ Addedscss-tokenizer@0.2.3(transitive)
+ Addedsemver@5.3.0(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsource-map@0.4.4(transitive)
+ Addedspdx-correct@3.2.0(transitive)
+ Addedspdx-exceptions@2.5.0(transitive)
+ Addedspdx-expression-parse@3.0.1(transitive)
+ Addedspdx-license-ids@3.0.20(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstdout-stream@1.4.1(transitive)
+ Addedstring-width@1.0.23.1.0(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedstrip-ansi@3.0.15.2.0(transitive)
+ Addedstrip-bom@2.0.0(transitive)
+ Addedstrip-indent@1.0.1(transitive)
+ Addedsupports-color@2.0.0(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedtar@2.2.2(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtrim-newlines@1.0.0(transitive)
+ Addedtrue-case-path@1.0.3(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedvalidate-npm-package-license@3.0.4(transitive)
+ Addedverror@1.10.0(transitive)
+ Addedwhich@1.3.1(transitive)
+ Addedwhich-module@2.0.1(transitive)
+ Addedwide-align@1.1.5(transitive)
+ Addedwrap-ansi@5.1.0(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedy18n@4.0.3(transitive)
+ Addedyallist@2.1.2(transitive)
+ Addedyargs@13.3.2(transitive)
+ Addedyargs-parser@13.1.2(transitive)