I’m creating a template override for k2 (although I guess in some ways this question could apply to any Joomla extension).
Now I’ve created my override in template/html/com_k2 absolutely fine. Then I went to go and update the stylesheet. Now as far as I’m aware I can do one of two things:
-
Change the K2 CSS style sheet. BUT this means that every time I update k2 the style sheet gets overridden – far from ideal!
-
Add a new K2 specific style sheet in my template. BUT this means I’m effectively loading the K2 style sheet twice – once for the component and then once again for the templates k2 style sheet. Now normally this wouldn’t be a major issue – but as the K2 style sheet is over 1000 lines long – this is going to start to have a performance impact – especially as k2 isn’t the only style sheet I’m going to need to override!
Are there any alternative ways of overriding the style sheets? Because both of these ideas are far from perfect as I’ve stated!
It really doesn’t matter where you put your custom css rules. You might be better off putting them in the Joomla! template’s custom.css file.
But if your concern is about one extra css file, look at your page: you might have more than 10, depending on template and extensions: so dealing with the extra one won’t make a difference; but the “right way” would require:
a) compacting all css into one (taking care of different relative paths)
b) minifying the result
This of course means editing all components and modules views that add css rules and links, a massive work.