docs: Update README.md

This commit is contained in:
Cole Bemis 2017-12-12 22:49:58 -08:00 committed by GitHub
parent ad8fabb569
commit c1f40d07c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -164,7 +164,7 @@ See the [API Reference](#api-reference) for more information about the available
### `feather.icons` ### `feather.icons`
An object with information about every icon. An object with data about every icon.
#### Usage #### Usage
@ -172,7 +172,7 @@ An object with information about every icon.
feather.icons.x feather.icons.x
// { // {
// name: 'x', // name: 'x',
// contents: '<line ... /><line ... />`, // contents: '<line ... /><line ... />',
// tags: ['cancel', 'close', 'delete', 'remove'], // tags: ['cancel', 'close', 'delete', 'remove'],
// attrs: { // attrs: {
// class: 'feather feather-x', // class: 'feather feather-x',
@ -189,11 +189,13 @@ feather.icons.x
// } // }
feather.icons.x.toString() feather.icons.x.toString()
// '<line ... /><line ... />` // '<line ... /><line ... />'
``` ```
[View Source](https://github.com/colebemis/feather/blob/master/src/icons.js) [View Source](https://github.com/colebemis/feather/blob/master/src/icons.js)
---
### `feather.icons[name].toSvg([attrs])` ### `feather.icons[name].toSvg([attrs])`
Returns an SVG string. Returns an SVG string.
@ -219,6 +221,8 @@ feather.icons.circle.toSvg({ class: 'foo bar' })
[View Source](https://github.com/colebemis/feather/blob/master/src/icon.js) [View Source](https://github.com/colebemis/feather/blob/master/src/icon.js)
---
### `feather.replace([attrs])` ### `feather.replace([attrs])`
Replaces all elements that have a `data-feather` attribute with SVG markup corresponding to the element's `data-feather` attribute value. Replaces all elements that have a `data-feather` attribute with SVG markup corresponding to the element's `data-feather` attribute value.
@ -275,6 +279,8 @@ All attributes on the placeholder element (i.e. `<i>`) will be copied to the `<s
[View Source](https://github.com/colebemis/feather/blob/master/src/replace.js) [View Source](https://github.com/colebemis/feather/blob/master/src/replace.js)
---
### [DEPRECATED] `feather.toSvg(name, [attrs])` ### [DEPRECATED] `feather.toSvg(name, [attrs])`
> **Note:** `feather.toSvg()` is deprecated. Please use `feather.icons[name].toSvg()` instead. > **Note:** `feather.toSvg()` is deprecated. Please use `feather.icons[name].toSvg()` instead.