• We have redone the forum. If you notice any issues or errors please open a Support Ticket under the Members dropdown and let us know.
U

How to dynamically use FontAwesome icons in CSS with XenForo templates?

  • Thread starter Thread starter unutKan
  • Start date Start date
U

unutKan

Guest

Hi all,

I'm developing a XenForo 2.3 add-on and need to show icons dynamically based on template variables.

I have a variable like {$item.iconClass} that contains icon classes such as "fal fa-award".

In HTML, this works fine:

<xf:fa icon="{$item.iconClass}" />

But I want to use these icons in CSS pseudo-elements with the .m-faContent() LESS mixin, like this:

Less:
Code:
&:before {
    .m-faContent({$item.iconClass});
}

This doesn't work because .m-faContent() expects a...

Read more

Continue reading...
 
Similar threads Most view View more
Back
Top