-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add customize.md and publish all design resources (#29)
- add customize.md - publish all design resources - fix #19 - update usage.md and install.md for v1.3.0
- Loading branch information
Showing
7 changed files
with
181 additions
and
41 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
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
title: Customize | ||
description: QWeather Icons project helps you create customized icons and icon fonts. | ||
--- | ||
|
||
You may want to change the icons color or redesign the icons to better fit your project style. Here's how to create your customized icons and fonts using the QWeather Icons project. | ||
|
||
## Edit Icons and Fonts | ||
|
||
👉 [Get all design resources in Figma](https://www.figma.com/community/file/1196353857920331062) | ||
|
||
You can change the color or redesign these icons, and then export new images in SVG or other formats. | ||
|
||
If you need to create new fonts, you must: | ||
|
||
- Export the icons in SVG format. | ||
- SVGs must be **Flatten** and **Outline stroke** | ||
- Make sure the value of `fill-rule` for SVGs **IS NOT** `evenodd`. If you are editing in Figma, it is recommended to use [Fill Rule Editor](https://www.figma.com/community/plugin/771155994770327940) to fix it. | ||
|
||
Once your icons and fonts are redesigned, go to [Run QWeather Icons](#run-qweather-icons) below to optimize the SVGs (we use [SVGO](https://github.com/svg/svgo)) and create the icon fonts. | ||
|
||
## Run QWeather Icons | ||
|
||
The QWeather Icons project will help you optimize SVGs and create new icon fonts. | ||
|
||
#### 1. Install Node.js | ||
|
||
[Download and install Node.js](https://nodejs.org), we tested in v14 and v18. Typically, other versions are supported as well. | ||
|
||
#### 2. Download source code for QWeather Icons | ||
|
||
```sh | ||
git clone https://github.com/qwd/Icons.git | ||
``` | ||
|
||
#### 3. Import customized SVGs | ||
|
||
Paste all your customized SVGs into the `/icons` and replace the original SVGs. | ||
|
||
If there are new/deleted/renamed SVGs, you need to edit the `icons-list.json` file. | ||
|
||
#### 4. Install Dependencies | ||
|
||
Go into the project directory and install the dependencies (this may take some time depending on your network environment): | ||
|
||
``` | ||
npm install | ||
``` | ||
|
||
#### 5. Run | ||
|
||
``` | ||
npm run icons | ||
``` | ||
|
||
Wait a moment, all SVGs are generated in `/icons`, and fonts are generated in `/font`, you can also open `/font/demo.html` to see the demo. | ||
|
||
Done 🎉 |
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
title: 自定义 | ||
description: QWeather Icons 项目可以帮助你创建自定义图标和图标字体。 | ||
--- | ||
|
||
各花入各眼,你可能希望修改图标的颜色,或者修改一些图标样式以更加适配你的设计风格,这里将介绍如何使用和风天气项目创建你的自定义图标和字体。 | ||
|
||
## 编辑图标和字体 {#edit-icons-and-fonts} | ||
|
||
👉 [在Figma中获取所有设计文件](https://www.figma.com/community/file/1196353857920331062) | ||
|
||
你可以对这些图标修改颜色或调整样式,然后导出新的SVG或其他格式的图片。 | ||
|
||
如果需要创建新的字体,你必须: | ||
|
||
- 导出SVG格式的图标 | ||
- SVG图片必须进行**Flatten**和**Outline stroke**操作 | ||
- 确保SVG图片的`fill-rule`的值**不是**`evenodd`。如果你是在Figma中进行的编辑,推荐使用[Fill Rule Editor](https://www.figma.com/community/plugin/771155994770327940)这个插件来修正。 | ||
|
||
当完成上述图标和字体的重新设计后,参考下方[运行QWeather Icons](#run-qweather-icons),可以对SVG图标进行压缩和优化(我们使用[SVGO](https://github.com/svg/svgo))并创建字体。 | ||
|
||
## 运行 QWeather Icons {#run-qweather-icons} | ||
|
||
QWeather Icons项目将帮助你优化SVG图标和创建新的字体。 | ||
|
||
#### 1. 安装Node.js | ||
|
||
请访问 <https://nodejs.org> 下载并安装Node.js,我们在v14和v18版本测试通过。 | ||
|
||
#### 2. 下载项目 | ||
|
||
```sh | ||
git clone https://github.com/qwd/Icons.git | ||
``` | ||
|
||
#### 3. 导入自定义SVG | ||
|
||
将你修改后的所有SVG粘贴到`/icons`目录下并替换原文件。 | ||
|
||
如果有新增/删除/重命名的图标,你需要编辑`icons-list.json`文件。 | ||
|
||
#### 4. 安装依赖 | ||
|
||
进入项目目录,安装依赖库(这可能会需要一些时间,取决于你的网络环境,或者尝试更改npm源): | ||
|
||
``` | ||
npm install | ||
``` | ||
|
||
#### 5. 运行 | ||
|
||
``` | ||
npm run icons | ||
``` | ||
|
||
稍等片刻,所有SVG图标在`/icons`目录生成,字体文件在`/font`目录下生成,你也可以打开`/font/demo.html`查看效果。 | ||
|
||
搞定 🎉 |
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
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
Oops, something went wrong.