Compare commits
56 Commits
Author | SHA1 | Date | |
---|---|---|---|
ee36bff7c3 | |||
ac06ad8999 | |||
5d6c7d2184 | |||
998b2e9add | |||
0e70a99e8a | |||
ef3e69b327 | |||
71f502fc95 | |||
ae164db70f | |||
c089ee1f89 | |||
9b5dc81118 | |||
75068f6625 | |||
577494e969 | |||
704870bb12 | |||
8fbe71d45f | |||
1e43dcb17e | |||
6c7b365e4b | |||
9cb49e1b6f | |||
40f5908d49 | |||
c64304d17c | |||
3c297deb40 | |||
dd9f0ff1a3 | |||
e1107aaee2 | |||
dfcd3e3ba2 | |||
915524f6d3 | |||
650c8ab167 | |||
89ed5ac57a | |||
f0a061e2f2 | |||
044aff8034 | |||
765b91733f | |||
82a62ca029 | |||
a4a1feda04 | |||
0b5f9d44a5 | |||
e0facf6fbf | |||
4fa54b53ee | |||
8c12a6d89d | |||
a5a3d7d08d | |||
612ab72d77 | |||
b6f3986191 | |||
f6f83d9864 | |||
d5eeaeedc9 | |||
adbc129119 | |||
1356b013b7 | |||
99c7c7fcfb | |||
cede242106 | |||
85dca37e6d | |||
5554766f88 | |||
8c95eacb15 | |||
681f00acbe | |||
d924d93c64 | |||
7d1273eef0 | |||
14731962d2 | |||
de03f1cbb4 | |||
fe9fb15fe5 | |||
96bfb52215 | |||
680eeb3c0b | |||
7fec7374be |
1
.eslintignore
Normal file
@ -0,0 +1 @@
|
||||
dist
|
12
.eslintrc.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "airbnb-base",
|
||||
"plugins": [
|
||||
"import"
|
||||
],
|
||||
"rules": {
|
||||
"no-use-before-define": "off",
|
||||
"arrow-parens": ["error", "as-needed"],
|
||||
"no-shadow": "off",
|
||||
"no-console": ["error", { "allow": ["warn", "error"] }]
|
||||
}
|
||||
}
|
4
.gitignore
vendored
@ -1,7 +1,5 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
_site
|
||||
*.zip
|
||||
manifest.json
|
||||
dist
|
||||
sandbox
|
||||
stash
|
||||
|
13
.travis.yml
Normal file
@ -0,0 +1,13 @@
|
||||
language: node_js
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
notifications:
|
||||
email: false
|
||||
node_js: 6
|
||||
before_script:
|
||||
- npm prune
|
||||
script:
|
||||
- npm run all
|
||||
after_success:
|
||||
- npm run semantic-release
|
238
CHANGELOG.md
@ -1,238 +0,0 @@
|
||||
# Change Log
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## v2.1.0 (2017-05-30)
|
||||
|
||||
### Added
|
||||
|
||||
- Add icon categories (Thanks @wappsdotgr)
|
||||
- Display icon names to allow for <kbd>⌘</kbd> + <kbd>F</kbd> search
|
||||
|
||||
<details>
|
||||
<summary>Add 37 icons</summary>
|
||||
|
||||
- `arrow-down-left`
|
||||
- `arrow-down-right`
|
||||
- `arrow-up-left`
|
||||
- `arrow-up-right`
|
||||
- `battery-charging`
|
||||
- `cast`
|
||||
- `chevrons-down`
|
||||
- `chevrons-left`
|
||||
- `chevrons-right`
|
||||
- `chevrons-up`
|
||||
- `cloud-drizzle`
|
||||
- `cloud-lightning`
|
||||
- `cloud-rain`
|
||||
- `cloud-snow`
|
||||
- `codepen`
|
||||
- `compass`
|
||||
- `edit-2`
|
||||
- `edit-3`
|
||||
- `link-2`
|
||||
- `list`
|
||||
- `log-in`
|
||||
- `log-out`
|
||||
- `navigation-2`
|
||||
- `package`
|
||||
- `repeat`
|
||||
- `share`
|
||||
- `slack`
|
||||
- `speaker`
|
||||
- `trending-down`
|
||||
- `trending-up`
|
||||
- `type`
|
||||
- `user-check`
|
||||
- `user-x`
|
||||
- `voicemail`
|
||||
- `volume`
|
||||
- `volume-1`
|
||||
- `volume-2`
|
||||
</details>
|
||||
|
||||
### Changed
|
||||
|
||||
- Redesign project site
|
||||
|
||||
<details>
|
||||
<summary>Change 9 icons</summary>
|
||||
|
||||
- `bar-chart`
|
||||
- `bar-chart-2`
|
||||
- `droplet`
|
||||
- `grid`
|
||||
- `twitter`
|
||||
- `user-minus`
|
||||
- `user-plus`
|
||||
- `user`
|
||||
- `volume-x`
|
||||
</details>
|
||||
|
||||
## v2.0.0 (2017-05-23)
|
||||
|
||||
### Added
|
||||
<details>
|
||||
<summary>Add 63 icons</summary>
|
||||
|
||||
- `activity`
|
||||
- `alert-circle`
|
||||
- `alert-octagon`
|
||||
- `alert-triangle`
|
||||
- `aperture`
|
||||
- `at-sign`
|
||||
- `award`
|
||||
- `bell-off`
|
||||
- `bluetooth`
|
||||
- `calendar`
|
||||
- `camera-off`
|
||||
- `chevron-down`
|
||||
- `chevron-left`
|
||||
- `chevron-right`
|
||||
- `chevron-up`
|
||||
- `chrome`
|
||||
- `circle`
|
||||
- `cloud-off`
|
||||
- `comment-circle`
|
||||
- `cpu`
|
||||
- `edit`
|
||||
- `eye-off`
|
||||
- `facebook`
|
||||
- `feather`
|
||||
- `female`
|
||||
- `filter`
|
||||
- `hash`
|
||||
- `headphones`
|
||||
- `home`
|
||||
- `info`
|
||||
- `instagram`
|
||||
- `male`
|
||||
- `map-pin`
|
||||
- `mic-off`
|
||||
- `more-vertical`
|
||||
- `music`
|
||||
- `octagon`
|
||||
- `phone`
|
||||
- `phone-call`
|
||||
- `phone-forwarded`
|
||||
- `phone-incoming`
|
||||
- `phone-missed`
|
||||
- `phone-off`
|
||||
- `phone-outgoing`
|
||||
- `pocket`
|
||||
- `radio`
|
||||
- `refresh-ccw`
|
||||
- `rotate-ccw`
|
||||
- `scissors`
|
||||
- `square`
|
||||
- `sunrise`
|
||||
- `sunset`
|
||||
- `thumbs-down`
|
||||
- `thumbs-up`
|
||||
- `toggle-right`
|
||||
- `trash-2`
|
||||
- `triangle`
|
||||
- `twitter`
|
||||
- `user-minus`
|
||||
- `user-plus`
|
||||
- `video-off`
|
||||
- `wind`
|
||||
- `zap`
|
||||
</details>
|
||||
|
||||
### Changed
|
||||
|
||||
- Redesign project website
|
||||
- Use SVG `stroke` instead of `fill`. Read more about the benefits of SVG `stroke`:
|
||||
- [SVG Stroke FTW!](http://danklammer.com/articles/svg-stroke-ftw/)
|
||||
|
||||
<details>
|
||||
<summary>Change 66 icons</summary>
|
||||
|
||||
- `align-center`
|
||||
- `anchor`
|
||||
- `arrow-down`
|
||||
- `arrow-left`
|
||||
- `arrow-right`
|
||||
- `arrow-up`
|
||||
- `bar-chart`
|
||||
- `bar-chart-2`
|
||||
- `battery`
|
||||
- `bell`
|
||||
- `book`
|
||||
- `bookmark`
|
||||
- `box`
|
||||
- `briefcase`
|
||||
- `camera`
|
||||
- `check`
|
||||
- `check-circle`
|
||||
- `check-square`
|
||||
- `clipboard`
|
||||
- `cloud`
|
||||
- `comment-square`
|
||||
- `download`
|
||||
- `download-cloud`
|
||||
- `droplet`
|
||||
- `external-link`
|
||||
- `fast-forward`
|
||||
- `file`
|
||||
- `flag`
|
||||
- `folder`
|
||||
- `heart`
|
||||
- `image`
|
||||
- `inbox`
|
||||
- `layers`
|
||||
- `layout`
|
||||
- `lock`
|
||||
- `mail`
|
||||
- `maximize`
|
||||
- `maximize-2`
|
||||
- `minimize`
|
||||
- `minimize-2`
|
||||
- `minus`
|
||||
- `moon`
|
||||
- `move`
|
||||
- `pause`
|
||||
- `play`
|
||||
- `plus`
|
||||
- `printer`
|
||||
- `search`
|
||||
- `settings`
|
||||
- `share`
|
||||
- `shuffle`
|
||||
- `skip-back`
|
||||
- `skip-forward`
|
||||
- `star`
|
||||
- `rewind`
|
||||
- `tag`
|
||||
- `unlock`
|
||||
- `upload`
|
||||
- `upload-cloud`
|
||||
- `user`
|
||||
- `video`
|
||||
- `watch`
|
||||
- `wifi`
|
||||
- `x`
|
||||
- `zoom-in`
|
||||
- `zoom-out`
|
||||
</details>
|
||||
|
||||
### Removed
|
||||
- Remove PSD, CSH and Webfont formats in favor of SVG. Read more about the benefits of SVG for icons:
|
||||
- [Inline SVG vs Icon Fonts [CAGEMATCH]](https://css-tricks.com/icon-fonts-vs-svg/)
|
||||
- [Seriously, Don’t Use Icon Fonts](https://cloudfour.com/thinks/seriously-dont-use-icon-fonts/)
|
||||
- [Ten reasons we switched from icon font to SVG](http://ianfeather.co.uk/ten-reasons-we-switched-from-an-icon-font-to-svg/)
|
||||
|
||||
## v1.1.0 (2014-04-27)
|
||||
|
||||
### Added
|
||||
- Add 30 new icons
|
||||
- Add CSH, SVG and Webfont formats
|
||||
|
||||
### Changed
|
||||
- Change all PSD icon layers to vector shapes
|
||||
|
||||
## v1.0.0 (2013-11-27)
|
||||
- Initial release
|
74
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,74 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at cole@colebemis.com. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
4
Gemfile
@ -1,4 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "jekyll"
|
47
Gemfile.lock
@ -1,47 +0,0 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
addressable (2.5.1)
|
||||
public_suffix (~> 2.0, >= 2.0.2)
|
||||
colorator (1.1.0)
|
||||
ffi (1.9.18)
|
||||
forwardable-extended (2.6.0)
|
||||
jekyll (3.4.3)
|
||||
addressable (~> 2.4)
|
||||
colorator (~> 1.0)
|
||||
jekyll-sass-converter (~> 1.0)
|
||||
jekyll-watch (~> 1.1)
|
||||
kramdown (~> 1.3)
|
||||
liquid (~> 3.0)
|
||||
mercenary (~> 0.3.3)
|
||||
pathutil (~> 0.9)
|
||||
rouge (~> 1.7)
|
||||
safe_yaml (~> 1.0)
|
||||
jekyll-sass-converter (1.5.0)
|
||||
sass (~> 3.4)
|
||||
jekyll-watch (1.5.0)
|
||||
listen (~> 3.0, < 3.1)
|
||||
kramdown (1.13.2)
|
||||
liquid (3.0.6)
|
||||
listen (3.0.8)
|
||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||
rb-inotify (~> 0.9, >= 0.9.7)
|
||||
mercenary (0.3.6)
|
||||
pathutil (0.14.0)
|
||||
forwardable-extended (~> 2.6)
|
||||
public_suffix (2.0.5)
|
||||
rb-fsevent (0.9.8)
|
||||
rb-inotify (0.9.8)
|
||||
ffi (>= 0.5.0)
|
||||
rouge (1.11.1)
|
||||
safe_yaml (1.0.4)
|
||||
sass (3.4.23)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
jekyll
|
||||
|
||||
BUNDLED WITH
|
||||
1.14.5
|
31
Makefile
Normal file
@ -0,0 +1,31 @@
|
||||
src_files := src/*.js
|
||||
src_dir := src
|
||||
|
||||
.PHONY: all lint build
|
||||
|
||||
all: lint build
|
||||
|
||||
lint: dist/icons.json
|
||||
./node_modules/.bin/eslint .
|
||||
|
||||
build: dist/feather.js dist/feather.min.js dist/icons
|
||||
|
||||
node_modules:
|
||||
npm install
|
||||
|
||||
dist:
|
||||
mkdir dist
|
||||
|
||||
dist/icons.json: node_modules dist icons icons/*.svg
|
||||
./node_modules/.bin/babel-node bin/build-json.js
|
||||
|
||||
dist/feather.js: dist/icons.json $(src_dir) $(src_files)
|
||||
./node_modules/.bin/webpack --output-filename feather.js
|
||||
|
||||
dist/feather.min.js: dist/icons.json $(src_dir) $(src_files)
|
||||
./node_modules/.bin/webpack --output-filename feather.min.js -p
|
||||
|
||||
dist/icons: dist/icons.json
|
||||
rm -rf dist/icons
|
||||
mkdir -p dist/icons
|
||||
./node_modules/.bin/babel-node bin/build-svgs.js
|
11
README.md
@ -1,16 +1,19 @@
|
||||
[Feather](https://feather.netlify.com)
|
||||
[Feather](https://feathericons.com)
|
||||
===
|
||||
|
||||
### Simply beautiful open source icons
|
||||
|
||||
Designed on a 24x24 grid with an emphasis on functionality, consistency and simplicity.
|
||||
|
||||
Change Log
|
||||
*Documentation coming soon*
|
||||
|
||||
Related Projects
|
||||
---
|
||||
|
||||
See [CHANGELOG.md](https://github.com/colebemis/feather/blob/gh-pages/CHANGELOG.md)
|
||||
- [angular-feather](https://github.com/michaelbazos/angular-feather) - Feather icons for Angular applications
|
||||
- [react-feather](https://github.com/carmelopullara/react-feather) - Feather icons as React components
|
||||
|
||||
License
|
||||
---
|
||||
|
||||
Feather is released under the [MIT License](http://opensource.org/licenses/MIT). In short, you are free to use Feather in any personal, open-source or commercial work. Attribution is optional but appreciated.
|
||||
Feather is licensed under the [MIT License](http://opensource.org/licenses/MIT).
|
||||
|
10
_config.yml
@ -1,10 +0,0 @@
|
||||
data_dir: .
|
||||
exclude:
|
||||
- README.md
|
||||
- CHANGELOG.md
|
||||
- ISSUE_TEMPLATE.md
|
||||
- LICENSE
|
||||
- node_modules
|
||||
- bin
|
||||
- sandbox
|
||||
- stash
|
@ -1,11 +0,0 @@
|
||||
<div class="pv4">
|
||||
<h2 class="mt0 mb4 f6 ttu tracked normal">{{ include.category | replace: '-', ' '}}</h2>
|
||||
<ul class="icon-grid mv0 pl0 list">
|
||||
{% capture category_path %}icons/{{ include.category }}{% endcapture %}
|
||||
{% for icon in site.static_files %}
|
||||
{% if icon.path contains category_path %}
|
||||
{% include icon.html icon=icon %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
@ -1,13 +0,0 @@
|
||||
<footer class="flex flex-column items-center pt5-ns pb5">
|
||||
<ul class="flex flex-column flex-row-l justify-center w-80 mv0 pl0 list">
|
||||
{% for link in include.links %}
|
||||
<li class="mh3-l pv3 pv0-l f5 bb b--black-10 bn-l">
|
||||
<a class="lh-copy color-inherit no-underline dim" href="{{ link.url }}" target="_blank">{{ link.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<p class="mt5 mb2 lh-copy black-90 dim">
|
||||
<a class="no-underline color-inherit" href="http://colebemis.com" target="_blank">Made with <3 by Cole Bemis</a>
|
||||
</p>
|
||||
</footer>
|
@ -1,11 +0,0 @@
|
||||
<header class="pv3 bb b--black-10">
|
||||
<div class="w-80 center flex justify-between items-center">
|
||||
<h1 class="mv0 normal f3 lh-copy black-90">Feather <span class="f5 black-60">v{{ site.data.package.version }}</span></h1>
|
||||
|
||||
<ul class="list mv0 pl0 flex">
|
||||
<li class="dn dib-ns"><a class="no-underline color-inherit dim" href="https://twitter.com/intent/tweet?text=Feather%20-%20Simply%20beautiful%20open%20source%20icons%20by%20%40colebemis%20feather.netlify.com" target="_blank">Tweet</a></li>
|
||||
<li class="dn dib-ns ml4"><a class="no-underline color-inherit dim" href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=G6CPFZ6PQRZW8&lc=US&item_name=Feather¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted" target="_blank">Donate</a></li>
|
||||
<li class="ml4"><a class="no-underline color-inherit dim" href="https://github.com/colebemis/feather" target="_blank">GitHub</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
@ -1,10 +0,0 @@
|
||||
<div class="flex flex-column items-center w-80 mw8 pt5 pt6-ns center">
|
||||
<h2 class="mt0 mb4 f2 fw3 tc lh-title black-90">Simply beautiful open source icons</h2>
|
||||
<a
|
||||
class="button white bg-accent bg-animate hover-bg-accent-darker br2"
|
||||
href="feather-{{ site.data.package.version }}.zip"
|
||||
download
|
||||
onclick="ga('send', 'event', 'download', 'click', 'all');">
|
||||
Download
|
||||
</a>
|
||||
</div>
|
@ -1,10 +0,0 @@
|
||||
<li>
|
||||
<a
|
||||
href="{{ include.icon.path }}"
|
||||
class="flex flex-row items-center dib pa3 br2 no-underline dark-gray bg-near-white bg-animate hover-bg-light-gray"
|
||||
download
|
||||
onclick="ga('send', 'event', 'download', 'click', '{{ include.icon.basename }}');">
|
||||
<span class="svg flex-none lh-none">{% include_relative {{ include.icon.path }} %}</span>
|
||||
<span class="ml3 lh-copy f6 tc black-60 ellipse">{{ include.icon.basename }}</span>
|
||||
</a>
|
||||
</li>
|
@ -1,10 +0,0 @@
|
||||
<div class="w-80 center pv5">
|
||||
{% include category.html category="core" %}
|
||||
{% include category.html category="media-controls" %}
|
||||
{% include category.html category="communication" %}
|
||||
{% include category.html category="photo-and-video" %}
|
||||
{% include category.html category="location" %}
|
||||
{% include category.html category="weather" %}
|
||||
{% include category.html category="arrows" %}
|
||||
{% include category.html category="logos" %}
|
||||
</div>
|
Before Width: | Height: | Size: 484 B |
Before Width: | Height: | Size: 37 KiB |
71
bin/build-json.js
Executable file
@ -0,0 +1,71 @@
|
||||
/**
|
||||
* @file Builds `icons.json` from `icons` directory.
|
||||
*/
|
||||
|
||||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import RSVP from 'rsvp';
|
||||
import Svgo from 'svgo';
|
||||
import parse5 from 'parse5';
|
||||
|
||||
const svgFiles = fs.readdirSync(path.resolve(__dirname, '../icons'))
|
||||
.filter(file => path.extname(file) === '.svg');
|
||||
|
||||
buildIconsObject(svgFiles)
|
||||
.then(icons => {
|
||||
fs.writeFileSync(
|
||||
path.resolve(__dirname, '../dist/icons.json'),
|
||||
JSON.stringify(icons),
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* Build an icons object in the format: `{ <icon name>: <svg content> }`.
|
||||
* @param {string[]} svgFiles - A list of file names.
|
||||
* @returns {RSVP.Promise<Object>}
|
||||
*/
|
||||
function buildIconsObject(svgFiles) {
|
||||
const icons = {};
|
||||
|
||||
svgFiles.forEach(svgFile => {
|
||||
const svg = fs.readFileSync(path.resolve(__dirname, '../icons', svgFile), 'utf8');
|
||||
const key = path.basename(svgFile, '.svg');
|
||||
|
||||
icons[key] = optimizeSvg(svg)
|
||||
.then(optimizedSvg => getSvgContent(optimizedSvg));
|
||||
});
|
||||
|
||||
return RSVP.hash(icons);
|
||||
}
|
||||
|
||||
/**
|
||||
* Optimize SVG with `svgo`.
|
||||
* @param {string} svg - An SVG string.
|
||||
* @returns {RSVP.Promise<string>}
|
||||
*/
|
||||
function optimizeSvg(svg) {
|
||||
// configure svgo
|
||||
const svgo = new Svgo({
|
||||
plugins: [
|
||||
{ convertShapeToPath: false },
|
||||
{ mergePaths: false },
|
||||
{ removeAttrs: { attrs: '(fill|stroke.*)' } },
|
||||
],
|
||||
});
|
||||
|
||||
return new RSVP.Promise(resolve => {
|
||||
svgo.optimize(svg, ({ data }) => resolve(data));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get content between opening and closing `<svg>` tags.
|
||||
* @param {string} svg - An SVG string.
|
||||
* @returns {string}
|
||||
*/
|
||||
function getSvgContent(svg) {
|
||||
const fragment = parse5.parseFragment(svg);
|
||||
const content = parse5.serialize(fragment.childNodes[0]);
|
||||
return content;
|
||||
}
|
13
bin/build-svgs.js
Normal file
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @file Builds `dist/icons` directory.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { icons, toSvg } from '../src';
|
||||
|
||||
Object.keys(icons).forEach(icon => {
|
||||
const svg = toSvg(icon);
|
||||
|
||||
fs.writeFileSync(path.resolve(__dirname, `../dist/icons/${icon}.svg`), svg);
|
||||
});
|
@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# find and store current version number
|
||||
version=$(grep '"version"' package.json | cut -d '"' -f4)
|
||||
|
||||
# compress 'icons' directory into feather-[version].zip
|
||||
zip -r feather-${version}.zip ./icons/
|
18
examples/index.html
Normal file
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Feather</title>
|
||||
<script src="../dist/feather.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<i data-feather="eye"></i>
|
||||
<i data-feather="heart"></i>
|
||||
<i data-feather="feather"></i>
|
||||
|
||||
<script>
|
||||
feather.replace()
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Before Width: | Height: | Size: 238 B After Width: | Height: | Size: 238 B |
Before Width: | Height: | Size: 319 B After Width: | Height: | Size: 319 B |
Before Width: | Height: | Size: 305 B After Width: | Height: | Size: 305 B |
Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 363 B |
Before Width: | Height: | Size: 373 B After Width: | Height: | Size: 373 B |
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 351 B |
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 351 B |
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 351 B |
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 351 B |
Before Width: | Height: | Size: 303 B After Width: | Height: | Size: 303 B |
Before Width: | Height: | Size: 520 B After Width: | Height: | Size: 520 B |
Before Width: | Height: | Size: 352 B After Width: | Height: | Size: 352 B |
Before Width: | Height: | Size: 353 B After Width: | Height: | Size: 353 B |
Before Width: | Height: | Size: 266 B After Width: | Height: | Size: 266 B |
Before Width: | Height: | Size: 265 B After Width: | Height: | Size: 265 B |
Before Width: | Height: | Size: 266 B After Width: | Height: | Size: 266 B |
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 351 B |
Before Width: | Height: | Size: 352 B After Width: | Height: | Size: 352 B |
Before Width: | Height: | Size: 265 B After Width: | Height: | Size: 265 B |
Before Width: | Height: | Size: 281 B After Width: | Height: | Size: 281 B |
Before Width: | Height: | Size: 281 B After Width: | Height: | Size: 281 B |
Before Width: | Height: | Size: 501 B After Width: | Height: | Size: 501 B |
Before Width: | Height: | Size: 501 B After Width: | Height: | Size: 501 B |
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 552 B |
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 286 B |
Before Width: | Height: | Size: 334 B After Width: | Height: | Size: 334 B |
Before Width: | Height: | Size: 279 B After Width: | Height: | Size: 279 B |
Before Width: | Height: | Size: 253 B After Width: | Height: | Size: 253 B |
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 308 B |
Before Width: | Height: | Size: 247 B After Width: | Height: | Size: 247 B |
Before Width: | Height: | Size: 636 B After Width: | Height: | Size: 636 B |
Before Width: | Height: | Size: 301 B After Width: | Height: | Size: 301 B |
Before Width: | Height: | Size: 367 B After Width: | Height: | Size: 367 B |
Before Width: | Height: | Size: 342 B After Width: | Height: | Size: 342 B |
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 315 B |
Before Width: | Height: | Size: 436 B After Width: | Height: | Size: 436 B |
Before Width: | Height: | Size: 273 B After Width: | Height: | Size: 273 B |
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 296 B |
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 221 B |
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 221 B |
Before Width: | Height: | Size: 222 B After Width: | Height: | Size: 222 B |
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 221 B |
Before Width: | Height: | Size: 222 B After Width: | Height: | Size: 222 B |
Before Width: | Height: | Size: 353 B After Width: | Height: | Size: 353 B |
Before Width: | Height: | Size: 354 B After Width: | Height: | Size: 354 B |
Before Width: | Height: | Size: 353 B After Width: | Height: | Size: 353 B |
Before Width: | Height: | Size: 354 B After Width: | Height: | Size: 354 B |
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 402 B |
Before Width: | Height: | Size: 218 B After Width: | Height: | Size: 218 B |
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 260 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 383 B After Width: | Height: | Size: 383 B |
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 643 B After Width: | Height: | Size: 643 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 243 B After Width: | Height: | Size: 243 B |
Before Width: | Height: | Size: 792 B After Width: | Height: | Size: 792 B |
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 382 B |
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 387 B |
@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<rect x="9" y="2" width="13" height="13" rx="2" ry="2" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
<path d="M9 9H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-5" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
<rect x="9" y="9" width="13" height="13" rx="2" ry="2" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 404 B After Width: | Height: | Size: 404 B |
@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="12" cy="12" r="10"/>
|
||||
<polyline points="12 2 12 12 22 12"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 260 B |
4
icons/corner-down-left.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<polyline points="9 10 4 15 9 20" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
<path d="M20 4v7a4 4 0 0 1-4 4H4" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
</svg>
|
After Width: | Height: | Size: 351 B |
4
icons/corner-down-right.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<polyline points="15 10 20 15 15 20" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
<path d="M4 4v7a4 4 0 0 0 4 4h12" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
</svg>
|
After Width: | Height: | Size: 354 B |
4
icons/corner-left-down.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<polyline points="14 15 9 20 4 15" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
<path d="M20 4h-7a4 4 0 0 0-4 4v12" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
</svg>
|
After Width: | Height: | Size: 354 B |
4
icons/corner-left-up.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<polyline points="14 9 9 4 4 9" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
<path d="M20 20h-7a4 4 0 0 1-4-4V4" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
</svg>
|
After Width: | Height: | Size: 351 B |
4
icons/corner-right-down.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<polyline points="10 15 15 20 20 15" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
<path d="M4 4h7a4 4 0 0 1 4 4v12" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
</svg>
|
After Width: | Height: | Size: 354 B |
4
icons/corner-right-up.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<polyline points="10 9 15 4 20 9" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
<path d="M4 20h7a4 4 0 0 0 4-4V4" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
</svg>
|
After Width: | Height: | Size: 351 B |
4
icons/corner-up-left.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<polyline points="9 14 4 9 9 4" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
<path d="M20 20v-7a4 4 0 0 0-4-4H4" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
</svg>
|
After Width: | Height: | Size: 351 B |
4
icons/corner-up-right.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<polyline points="15 14 20 9 15 4" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
<path d="M4 20v-7a4 4 0 0 1 4-4h12" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
</svg>
|
After Width: | Height: | Size: 354 B |
Before Width: | Height: | Size: 623 B After Width: | Height: | Size: 623 B |
4
icons/credit-card.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<rect x="1" y="4" width="22" height="16" rx="2" ry="2" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
<line x1="1" y1="10" x2="23" y2="10" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
</svg>
|
After Width: | Height: | Size: 375 B |
Before Width: | Height: | Size: 390 B After Width: | Height: | Size: 390 B |
Before Width: | Height: | Size: 334 B After Width: | Height: | Size: 334 B |
Before Width: | Height: | Size: 254 B After Width: | Height: | Size: 254 B |