-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,13 +22,13 @@ The font can be served from a CDN such as [JSDelivr][jsdelivr-link] or [Unpkg][u | |
#### JSDelivr | ||
|
||
```html | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/simple-icons-font@v14/font/simple-icons.min.css" type="text/css"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/simple-icons-font@v13/font/simple-icons.min.css" type="text/css"> | ||
``` | ||
|
||
#### Unpkg | ||
|
||
```html | ||
<link rel="stylesheet" href="https://unpkg.com/simple-icons-font@v14/font/simple-icons.min.css" type="text/css"> | ||
<link rel="stylesheet" href="https://unpkg.com/simple-icons-font@v13/font/simple-icons.min.css" type="text/css"> | ||
``` | ||
|
||
These examples use the latest major version. This means you won't receive any updates following the next major release. You can use `@latest` instead to receive updates indefinitely. However this may cause an icon to disappear if it has been removed in the latest version. | ||
|
@@ -79,6 +79,38 @@ Where `[ICON NAME]` is replaced by the icon name, for example: | |
|
||
In this example we use the `<i>` tag, but any inline HTML tag should work as you expect. | ||
|
||
## Custom Builds | ||
|
||
You can specify which icons need to be build for a better file size. | ||
|
||
1. Clone and install dependencies: | ||
|
||
```shell | ||
git clone [email protected]:simple-icons/simple-icons-font.git | ||
cd simple-icons-font | ||
npm install | ||
``` | ||
|
||
2. Use environment variable `SI_FONT_SLUGS_FILTER` to filter icons to include: | ||
|
||
```shell | ||
SI_FONT_SLUGS_FILTER=github,simpleicons npm run build | ||
``` | ||
|
||
Here are some available environment variables for custom build: | ||
|
||
- `SI_FONT_SLUGS_FILTER`: Comma separated string of slugs to include in the build. See [all slugs]. | ||
- `SI_FONT_PRESERVE_UNICODES`: By default, the build will retain the same unicode of an icon as the full build. You can set it to `false` to disable this. | ||
|
||
For example, if you set `SI_FONT_PRESERVE_UNICODES` to `false`, the unicode will still start at `0xea01` and keep increasing even you skipped some icons: | ||
|
||
```shell | ||
SI_FONT_SLUGS_FILTER=github,simpleicons SI_FONT_PRESERVE_UNICODES=false npm run build | ||
#=> github \u{EA01} | ||
#=> simpleicons \u{EA02} | ||
``` | ||
|
||
[latest-release]: https://github.com/simple-icons/simple-icons-font/releases/latest | ||
[jsdelivr-link]: https://www.jsdelivr.com/package/npm/simple-icons-font/ | ||
[unpkg-link]: https://unpkg.com/browse/simple-icons-font/ | ||
[all slugs]: https://github.com/simple-icons/simple-icons/blob/develop/slugs.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters