mirror of
https://github.com/FortAwesome/Font-Awesome.git
synced 2024-12-25 21:11:30 +08:00
Improve svg customization
parent
37e14bbea8
commit
500b49e6c8
@ -27,9 +27,10 @@ Prerequisites:
|
||||
JavaScript:
|
||||
```js
|
||||
// replace 1568, 1568 with your SVG viewbox
|
||||
// e001 is the unicode point which represents this custom icon. Increment this value for other icons
|
||||
// replace 'M256...' with your single-path SVG
|
||||
var faListOldStyle = {
|
||||
prefix: 'fac',
|
||||
prefix: 'fas',
|
||||
iconName: 'list-old-style',
|
||||
icon: [1568, 1568, [], 'e001', 'M256 1312v192q0 13-9.5 22.5t-22.5 9.5h-192q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h192q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5t-22.5 9.5h-192q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h192q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5t-22.5 9.5h-192q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h192q13 0 22.5 9.5t9.5 22.5zm1536 768v192q0 13-9.5 22.5t-22.5 9.5h-1344q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1344q13 0 22.5 9.5t9.5 22.5zm-1536-1152v192q0 13-9.5 22.5t-22.5 9.5h-192q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h192q13 0 22.5 9.5t9.5 22.5zm1536 768v192q0 13-9.5 22.5t-22.5 9.5h-1344q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1344q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5t-22.5 9.5h-1344q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1344q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5t-22.5 9.5h-1344q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1344q13 0 22.5 9.5t9.5 22.5z']
|
||||
}
|
||||
@ -41,7 +42,7 @@ FontAwesome.library.add(
|
||||
|
||||
HTML:
|
||||
```html
|
||||
<span class="fac fa-list-old-style"></span>
|
||||
<span class="fas fa-list-old-style"></span>
|
||||
```
|
||||
|
||||
Example: https://jsfiddle.net/tagliala/we7gtcvk/1/
|
||||
@ -55,9 +56,10 @@ JavaScript:
|
||||
import { library, dom } from '@fortawesome/fontawesome-svg-core'
|
||||
|
||||
// replace 1568, 1568 with your SVG viewbox
|
||||
// e001 is the unicode point which represents this custom icon. Increment this value for other icons
|
||||
// replace 'M256...' with your single-path SVG
|
||||
var faListOldStyle = {
|
||||
prefix: 'fac',
|
||||
prefix: 'fas',
|
||||
iconName: 'list-old-style',
|
||||
icon: [1568, 1568, [], 'e001', 'M256 1312v192q0 13-9.5 22.5t-22.5 9.5h-192q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h192q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5t-22.5 9.5h-192q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h192q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5t-22.5 9.5h-192q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h192q13 0 22.5 9.5t9.5 22.5zm1536 768v192q0 13-9.5 22.5t-22.5 9.5h-1344q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1344q13 0 22.5 9.5t9.5 22.5zm-1536-1152v192q0 13-9.5 22.5t-22.5 9.5h-192q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h192q13 0 22.5 9.5t9.5 22.5zm1536 768v192q0 13-9.5 22.5t-22.5 9.5h-1344q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1344q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5t-22.5 9.5h-1344q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1344q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5t-22.5 9.5h-1344q-13 0-22.5-9.5t-9.5-22.5v-192q0-13 9.5-22.5t22.5-9.5h1344q13 0 22.5 9.5t9.5 22.5z']
|
||||
}
|
||||
@ -71,7 +73,7 @@ dom.watch()
|
||||
|
||||
HTML:
|
||||
```html
|
||||
<span class="fac fa-my-custom-icon"></span>
|
||||
<span class="fas fa-my-custom-icon"></span>
|
||||
```
|
||||
|
||||
Docs: https://fontawesome.com/how-to-use/with-the-api/setup/getting-started
|
||||
|
Loading…
Reference in New Issue
Block a user