Skip to content

Commit

Permalink
feat: provide iconset import without iron-icon dependency
Browse files Browse the repository at this point in the history
Split iconset definition from vaadin-icons.html into new iconset.html (which is then imported in vaadin-icons.html).
This makes it so importing vaadin-icons.html works as before (and includes import of iron-icon) to maintain backwards compatibility, but now the developer also has the option to import the iconset without the iron-icon dependency by importing iconset.html directly. This is useful in some cases like when doing lazy asynchronous imports.

Fixes #72
  • Loading branch information
Haprog committed Mar 15, 2019
1 parent 978b2eb commit 30fa10f
Show file tree
Hide file tree
Showing 3 changed files with 652 additions and 660 deletions.
20 changes: 2 additions & 18 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,20 @@ gulp.task('icons', function() {
return '<g id="' + id + '">' + svg.children() + '</g>';
}
}))
.pipe(concat('vaadin-icons.html'))
.pipe(concat('iconset.html'))
.pipe(modify({
fileModifier: function(file, contents) {
/* eslint-disable max-len */
// Enclose all icons in an iron-iconset-svg
return /* html */`<!-- NOTICE: Generated with 'gulp icons' -->
<!--
@license
Copyright (c) 2015-2019 Vaadin Ltd.
Copyright (c) 2019 Vaadin Ltd.
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
-->
<link rel="import" href="../iron-icon/iron-icon.html">
<link rel="import" href="../iron-iconset-svg/iron-iconset-svg.html">
<!--
\`vaadin-icons\` is a set of 600+ icons which can be used together with
Polymer's [\`iron-icon\`](https://www.webcomponents.org/element/@polymer/iron-icon) component.
To use the \`vaadin-icons\` iconset, [install and import](https://github.com/vaadin/vaadin-icons#installation)
the iconset, and specify the icon as \`vaadin:<icon>\`. For example, to use
a cart icon, you would use:
\`\`\`html
<iron-icon icon="vaadin:cart"></iron-icon>
\`\`\`
For the complete list of available icons, see https://vaadin.com/components/vaadin-icons/html-examples
@pseudoElement vaadin-icons
@demo
-->
<iron-iconset-svg name="vaadin" size="16">
<svg><defs>
` + contents + `
Expand Down
Loading

0 comments on commit 30fa10f

Please sign in to comment.