I canโt talk about the โofficialโ right place, but I have a custom base controller that expands with all my controllers. I place global calls to registerCssFile() in the init() method of this base controller, so they are automatically registered on the whole site.
If you reuse files with a partial view, I can see how to register CSS in the view, which I assume, but ...
It is probably most appropriate to include all the CSS for the entire site in the init() controller method, and then combine and compress it using extensions like these .
(If in one view there isnโt a lot of custom CSS that is not used anywhere on the site, perhaps.)
EDIT: As indicated below by briiC.lv, using themes means that you want to save all CSS in your view / layout files, separate from the controller code.
source share