替代图标

By default, Discourse bundles icons from the excellent FontAwesome library. But there are a lot of free-to-use icon libraries out there. This topic is the home of alternative icon sets. It lists some theme components that you can try now, but it also describes how you can contribute to have Discourse support other icon sets.

Alternative icon sets

If you are interested in trying out a different icon set, here is a list of theme components that you can try out:

(See How to install a theme or theme component for help getting one of these repos in your Discourse site.)

These components are a work in progress. You can use them, but note that not every single icon from core will have an appropriate replacement. (Contributions are welcome, though, see below.)

Some screenshots:

Feather icons (using the WCAG Dark color scheme)


Heroicons (using the WCAG Light color scheme)


Unicons (using the Grey Amber color scheme)


Phosphor Duotone (using the WCAG Light color scheme)

Contributing

Theme developers and designers, this section is for you.

The components listed above are generated using the discourse-alt-icons utility repository, which streamlines replacing icons in Discourse core with icons from other open source icon sets. The heart of the repository is a build script that generates a theme component from a JSON file of icon name mappings.

Contributions are welcome and encouraged. Discourse uses many icons from FontAwesome and finding matches from other icon sets is a fun task, but it is time-consuming. If you want to help, you can pull the discourse-alt-icons and follow the steps in the readme to add matches for icons that don’t yet have them.

Supporting other icon sets

Please use the replies below to propose adding support for another icon set. Or, even better, with a little bit of work you can send a pull request to the discourse-alt-icons repository. Note, that only icon sets with very permissive licenses (i.e. must allow modification, distribution, private use) will be considered.


This document is version controlled - suggest changes on github.

29 个赞

If anyone is looking to contribute an icon set, but doesn’t have one in mind:

MIT licensed, designed by the folks over at tailwindlabs.com

4 个赞

Hope to help, here are some icons you can use

Nice suggestion, I added this and updated the OP with a screenshot. It doesn’t have a lot of icons, for example, it has no icons for the composer toolbar, but the icons it does have are quite nice. Thanks!

2 个赞

Does this mean that Google Fonts is out of the question?

Google’s Material Icons license is permissive enough. But their repo is gigantic, and it might be time-consuming to find the path to each icon.

1 个赞

Yes, but once it’s done, you won’t have to do it again. :slight_smile:

1 个赞

请问我们是否可以获得 Phosphor Regular 图标?

1 个赞

只需稍加努力,您(或任何人)就可以从双色存储库创建一个 Phosphorus Regular 存储库。如果我们有存储库,我很乐意在此列表进行审查并将其包含在内。

1 个赞

那将是惊人的。我们应该默认在 /admin 中有一个图标集列表,因为 FontAwesome 有点丑。:ok_man:

丑陋是品味问题。但如今 Font Awesome 提供的免费图标数量确实有限。

另一方面——有多少图标真的好看 :joy: