Tris20
(Tristan)
2024 年5 月 17 日 10:00
1
I’m trying to add the free, solid, beer icon as my discourse reactions like icon
:
Unfortunately the far- prefix is added to the “beer” text
and the regular icon is not included in the free tier:
so the icon does not load:
If this is intended, is there a workaround for this?
1 个赞
Firepup650
(Firepup Sixfifty)
2024 年5 月 17 日 10:45
2
By wild chance, does fas-beer
as the icon name work?
The icon works if you can’t like it anymore, but not when you can.
Looking at the code, when you liked already:
if (hasUsedMainReaction) {
return h(
"button.btn-toggle-reaction-like.btn-icon.no-text.reaction-button",
{
title: this.buildAttributes(attrs).title,
},
[iconNode(mainReactionIcon)]
);
}
When you did not like yet:
return h(
"button.btn-toggle-reaction-like.btn-icon.no-text.reaction-button",
{
title: this.buildAttributes(attrs).title,
},
[iconNode(`far-${mainReactionIcon}`)]
);
It expects a far—
version, which doesn’t seem to exist for beer
.
A quick solution in your case is to use the API to replace the far-beer
, for example:
<script type="text/discourse-plugin" version="0.8">
api.replaceIcon("far-beer", "beer");
</script>
I don’t know if a new setting should be introduced here or add some logic to use the same non-far version if the far-version doesn’t exist.
5 个赞
Tris20
(Tristan)
2024 年5 月 21 日 09:53
4
Sadly not, it’s empty just like above.
Arkshine:
A quick solution in your case is to use the API to replace the far-beer
, for example:
<script type="text/discourse-plugin" version="0.8">
api.replaceIcon("far-beer", "beer");
</script>
Thanks for taking a detailed look at this. Using the html above is definitely a good workaround for the forseeable future. We did this originally to replace the heart, but it completely slipped my mind that it could be used again to replace the far-beer too.
2 个赞