XF 2.0 Custom Style vs Template modifications

adamsmasher

Active member
If you could achieve the look of a custom style via template modifications (including using a custom CSS file), would that better or worse than just using a custom style? In XF 1.x, I made a custom style instead of using a lot of template modifications, but I've been wondering if I could make an add-on that includes template mods instead. Would their be a performance impact, or are we just talking Scotch vs Irish Whiskey. For the record I'm drinking Jameson tonight, but Laphroaig is my favorite drink. ;)
 
Performance won't be different. Template modifications are processed at save time, so they're not different than a direct template edit at run time.

We don't really recommend template mods for developing a custom style; they're not really built for that. (They're targeted at add-on developers.) Template mods generally have some disadvantages in that they tend to be somewhat more brittle, depending on how you write your match code (though if you're careful, I suppose it can be less brittle).

Overall though, we'd recommend just editing templates directly to create a custom style. The three-way merging system should help you get the core changes integrated after upgrades.
 
tl;dr: In the light of day I started thinking better of this after the novelty of addon-as-style wore off.

We have a several different add-ons I've ported over to XF2, and since I haven't done anything with a custom style yet I didn't bother including CSS with it. I just used classes and structure so they look fine with the master style - something I wanted to change over the XF 1.x versions so I don't need to style them separately in addition to the rest of the site. I thought it would interesting to make one style add-on to rule them all and the site itself, but in hindsight I'll lose the benefit of the template merging system pointing out what's changed.
 
Top Bottom