# 分类图标

**URL:** <https://meta.discourse.org/t/category-icons/104683>\
**Category:** Theme component\
**Tags:** official, deprecated, category-icons\
**Created:** [2018年十二月19日 16:22 UTC](https://meta.discourse.org/t/category-icons/104683 "2018-12-19T16:22:44Z")\
**Posts on this page:** 1\
**Showing post:** 75

<div class="post-metadata">

**Author:** ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)\
**Post date:** [2020年四月5日 11:37 UTC](https://meta.discourse.org/t/category-icons/104683/75 "2020-04-05T11:37:28Z")

</div>

1. 创建 SVG 精灵图：[Replace Discourse's default SVG icons with custom icons in a theme](https://meta.discourse.org/t/replace-discourses-default-svg-icons-with-custom-icons-in-a-theme/115736)
2. 在您的主题组件中上传精灵图，并将变量名设置为 `icons-sprite`：  
 ![image](https://global.discourse-cdn.com/meta/original/3X/f/a/fa8a44b4a133a8028f6064255020e07ae2f69653.png)
3. 在组件设置中，使用您想要的图标的 ID。例如，如果您的电子表格中有一个名为 `my-icon` 的图标 ID，您可以这样写：  
 ![image](https://global.discourse-cdn.com/meta/original/3X/5/f/5f0c15dd3cc95534cee84e5cd2d1fba47cb8d297.png)

结果：

 ![image](https://global.discourse-cdn.com/meta/original/3X/1/d/1dc41f86f126a4d29c04d1c516acf80c419b26b0.png)

---

_[View the full topic](https://meta.discourse.org/t/category-icons/104683)._
