XF 2.3 Thread status icons in XF 2.3--changing the style or icon in CSS/LESS?

Wildcat Media

Well-known member
Licensed customer
I'm cleaning up a theme I've been working on, and in XF 2.2 I was able to change the styling of the status icons in extra.less. It seems I can still do that in 2.3 with most of the status icons, but there are a few that don't seem to use the same CSS in the templates.

For instance, this works in 2.3 to change the icon from a bell to a pair of glasses (as it is the "watched" status indicator):

CSS:
.structItem-status--watched::before { .m-faIcon(@fa-var-solid-glasses-alt); }

Yet for the article icon, the CSS selectors aren't present. Instead, the classes are within the <i> tag:

1794619678282.webp

The "question thread" status indicator is similar.

Is there an easy (or perhaps "official") way to style these <i> tags? I prefer CSS, and I'm hoping I'm not going to have to resort to template edits.

And for my other status icons, is there a better (or official) way to do this than what I'm using now? I'm getting the right results, so I'm going to say that my CSS code is functional, but perhaps not ideal.



I also want to be sure I have all of the status icons covered. I have:

  • Solved
  • Sticky
  • Watched
  • Locked
  • Deleted
  • Redirect
  • Poll thread
  • Moderated
  • Upvoted
  • Article thread
  • Question thread
 
Unfortunately, XenForo does have some icons alternatively coded like this. Pure css/less likely wont make all the changes you need as you have figured out.

If this theme is something you plan on distibuting then the only option is using some template mods / extending XenForo classes. If you want to target them all you are looking at something like this:

Icon optionXenForo class targetedMethod to override
1. CategoryXF\Entity\NodegetNodeIcon()
2. DiscussionXF\ThreadType\DiscussionHandlergetTypeIconClass()
XF\ForumType\DiscussionHandlergetTypeIconClass()
3. ArticleXF\ThreadType\ArticleHandlergetTypeIconClass()
XF\ForumType\ArticleHandlergetTypeIconClass()
4. QuestionXF\ThreadType\QuestionHandlergetTypeIconClass()
XF\ForumType\QuestionHandlergetTypeIconClass()
5. SuggestionXF\ThreadType\SuggestionHandlergetTypeIconClass()
XF\ForumType\SuggestionHandlergetTypeIconClass()
6. PollXF\ThreadType\PollHandlergetTypeIconClass()
7. Search ForumXF\Entity\NodegetNodeIcon()
8. PageXF\Entity\NodegetNodeIcon()
XF\Entity\PagegetIcon()
9. Forum LinkXF\Entity\NodegetNodeIcon()
XF\ThreadType\RedirectHandlergetTypeIconClass()


If it's for personal use only you can use currently available add-ons that already do all these mods. There are a few out there like [DD] Node Icons & Tools.

1794661963109.webp
 
Thanks for the list. I had nearly everything covered.

I'll probably go with template edits for now, so I can get this project launched. I do wish they were consistent with the thread status icons though...
 
Back
Top Bottom