XF 2.2 Change up/down vote icons but only in Suggestion type, not Q&A

beerForo

Well-known member
I have a use case to use thumbs up and down in a Suggestion type but want to preserve the Q&A icons. Would anyone assist? Thanks for your time.
 
Solution
You can target the icons for those thread types using [data-template="thread_view_type_suggestion"] in the extra.less template, for example:

Less:
[data-template="thread_view_type_suggestion"]
{
    .contentVote-vote--up:before
    {
        content: "\f164";
    }
    .contentVote-vote--down:before
    {
        content: "\f165";
    }
}
You can target the icons for those thread types using [data-template="thread_view_type_suggestion"] in the extra.less template, for example:

Less:
[data-template="thread_view_type_suggestion"]
{
    .contentVote-vote--up:before
    {
        content: "\f164";
    }
    .contentVote-vote--down:before
    {
        content: "\f165";
    }
}
 
Solution
Thanks! And if I decide I want to change to thumbs up/down for questions also I can just change the icons overall with
Code:
.contentVote-vote.contentVote-vote--up:before {
}
Etc...
Correct?
 
Sine in this instance I will be using thumbs up/down, if I wanted to hide the reactions in the first post only (Suggestion-type), would that be as simple as a hide code?
 
You can target the icons for those thread types using [data-template="thread_view_type_suggestion"] in the extra.less template, for example:

Less:
[data-template="thread_view_type_suggestion"]
{
    .contentVote-vote--up:before
    {
        content: "\f164";
    }
    .contentVote-vote--down:before
    {
        content: "\f165";
    }
}
It is possible we can define the style of the fontawesome icon? In other words I want to use the solid version but it seems to be inheriting the regular since they are the same unicode. Can we use the class?
 
Untested:


CSS:
[data-template="thread_view_type_suggestion"]
{
    .contentVote-vote--up:before
    {
        content: "\f164";
        font-weight: 700;
    }
    .contentVote-vote--down:before
    {
        content: "\f165";
        font-weight: 700;
    }
}
 
I mean, each fontawesome has 5 versions. The unicode just defaults to the regular. But there is solid, regular, light, thin, duotone. How can we use the different ones in the extra.less?
 
Last edited:
The prefixes only work for inline icons, not CSS-based ones. In either case, you'll need to add the fa-duotone-900.woff2 (178kb) font to your site (in the font_awesome_setup template). Then you'd need something like (untested):

Less:
.contentVote-vote--up
{
    .m-faBase('Duotone', 900);
    .m-faBefore(@fa-var-trophy);
}
 
Back
Top Bottom