Skip to content

Commit 742f452

Browse files
authored
docs: Update README.md
1 parent 962870d commit 742f452

1 file changed

Lines changed: 20 additions & 16 deletions

File tree

README.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Feather is a collection of simply beautiful open source icons. Each icon is desi
1313

1414
https://feathericons.com
1515

16-
```sh
16+
```shell
1717
npm install feather-icons
1818
```
1919

@@ -77,21 +77,23 @@ The following are additional ways you can use Feather.
7777
7878
Install with [npm](https://docs.npmjs.com/getting-started/what-is-npm).
7979

80-
```
80+
```shell
8181
npm install feather-icons --save
8282
```
8383

8484
Or just copy [`feather.js`](https://unpkg.com/feather-icons/dist/feather.js) or [`feather.min.js`](https://unpkg.com/feather-icons/dist/feather.min.js) into your project directory. You don't need both `feather.js` and `feather.min.js`.
8585

8686
#### 2. Include
8787

88-
Include `feather.js` or `feather.min.js` with a `<script>` tag. These files are located in the `dist` directory of the npm package.
88+
Include `feather.js` or `feather.min.js` with a `<script>` tag:
8989

9090
```html
9191
<script src="path/to/dist/feather.js"></script>
9292
```
9393

94-
Or load the script from a CDN provider.
94+
> **Note:** `feather.js` and `feather.min.js` are located in the `dist` directory of the npm package.
95+
96+
Or load the script from a CDN provider:
9597

9698
```html
9799
<!-- choose one -->
@@ -103,7 +105,7 @@ After including the script, `feather` will be available as a global variable.
103105

104106
#### 3. Use
105107

106-
To use an icon on your page, add a `data-feather` attribute with the icon name to an element.
108+
To use an icon on your page, add a `data-feather` attribute with the icon name to an element:
107109

108110
```html
109111
<i data-feather="circle"></i>
@@ -113,7 +115,7 @@ See the complete list of icons at [feathericons.com](https://feathericons.com).
113115

114116
#### 4. Replace
115117

116-
Call the `feather.replace()` method.
118+
Call the `feather.replace()` method:
117119

118120
```html
119121
<script>
@@ -126,15 +128,15 @@ All elements that have a `data-feather` attribute will be replaced with SVG mark
126128
### Node
127129
#### 1. Install
128130

129-
Install with [npm](https://docs.npmjs.com/getting-started/what-is-npm).
131+
Install with [npm](https://docs.npmjs.com/getting-started/what-is-npm):
130132

131-
```
133+
```shell
132134
npm install feather-icons --save
133135
```
134136

135137
#### 2. Require
136138

137-
```javascript
139+
```js
138140
const feather = require('feather-icons')
139141
```
140142

@@ -157,7 +159,8 @@ feather.icons.x
157159
// 'stroke-width': 2,
158160
// 'stroke-linecap': 'round',
159161
// 'stroke-linejoin': 'round',
160-
// }
162+
// },
163+
// toSvg: [Function],
161164
// }
162165

163166
feather.icons.x.toSvg()
@@ -177,15 +180,15 @@ See the [API Reference](#api-reference) for more information about the available
177180
178181
Install with [npm](https://docs.npmjs.com/getting-started/what-is-npm).
179182

180-
```
183+
```shell
181184
npm install feather-icons --save
182185
```
183186

184187
Or just copy [`feather-sprite.svg`](https://unpkg.com/feather-icons/dist/feather-sprite.svg) into your project directory.
185188

186189
#### 2. Use
187190

188-
In your HTML, you can include an icon like so:
191+
Include an icon on your page with the following markup:
189192

190193
```html
191194
<svg
@@ -203,7 +206,7 @@ In your HTML, you can include an icon like so:
203206

204207
> **Note:** `circle` in the above example can be replaced with any valid icon name. See the complete list of icon names at [feathericons.com](https://feathericons.com).
205208
206-
However, this markup can be simplified using a simple CSS class to avoid repetition of SVG attributes between icons.
209+
However, this markup can be simplified using a simple CSS class to avoid repetition of SVG attributes between icons:
207210

208211
```css
209212
.feather {
@@ -248,7 +251,8 @@ feather.icons.x
248251
// 'stroke-width': 2,
249252
// 'stroke-linecap': 'round',
250253
// 'stroke-linejoin': 'round',
251-
// }
254+
// },
255+
// toSvg: [Function],
252256
// }
253257

254258
feather.icons.x.toString()
@@ -273,7 +277,7 @@ Returns an SVG string.
273277

274278
#### Usage
275279

276-
```javascript
280+
```js
277281
feather.icons.circle.toSvg()
278282
// '<svg class="feather feather-circle" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle></svg>'
279283

@@ -361,7 +365,7 @@ Returns an SVG string.
361365

362366
#### Usage
363367

364-
```javascript
368+
```js
365369
feather.toSvg('circle')
366370
// '<svg class="feather feather-circle" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle></svg>'
367371

0 commit comments

Comments
 (0)