XF 2.1 How to add CSS to an add-on using best practices?

Feanor

Active member
I have an add-on that adds a template to every post using a template modification. I need to style part of this template with CSS. I added it to a new .less template, but how do I call this template using best practices? Do I use <xf:css in the HTML template that goes in each post or would this add the .less template 20 times per page?
 

AndyB

Well-known member
I have an add-on that adds a template to every post using a template modification. I need to style part of this template with CSS. I added it to a new .less template, but how do I call this template using best practices? Do I use <xf:css in the HTML template that goes in each post or would this add the .less template 20 times per page?

Add the CSS to the extra.less template.
 
Top