When admins add custom CSS, they often do this via
This is easy and convenient (everything is in one place and not scattered over dozens of templates and there are no outdated templates / merge conflicts on upgrades) - but it is not efficient if a lot of CSS is added as all rules are loaded on every page even if they are only needed on specific pages.
Wouldn't it be great if we could add CSS like https://xenforo.com/community/resources/cxf-change-default-fa-node-icon.7491/ for node icons in
This could be achieved by adding a macro to
As it is right now, such a macro would not do anything - but if this macro was called at the end of
extra.less
.This is easy and convenient (everything is in one place and not scattered over dozens of templates and there are no outdated templates / merge conflicts on upgrades) - but it is not efficient if a lot of CSS is added as all rules are loaded on every page even if they are only needed on specific pages.
Wouldn't it be great if we could add CSS like https://xenforo.com/community/resources/cxf-change-default-fa-node-icon.7491/ for node icons in
extra.less
but only have this loaded when it is really required?This could be achieved by adding a macro to
extra.less
Code:
<xf:macro name="node_list">
// CSS for node icons here
</xf:macro>
As it is right now, such a macro would not do anything - but if this macro was called at the end of
node_list.less
this would work just fine and allow us to- Have custom CSS in one place
- Avoid trouble with outdated templates / merge conflicts on upgrades
- Have custom CSS only loaded when it is required
extra.less
at the end of every less template (except extra.less
).
Last edited:
Upvote
30