ZoneMinder / zoneminder

ZoneMinder is a free, open source Closed-circuit television software application developed for Linux which supports IP, USB and Analog cameras.
http://www.zoneminder.com/
GNU General Public License v2.0
4.84k stars 1.19k forks source link

Fix: CSS file loading order (functions.php) #3988

Closed IgorA100 closed 2 weeks ago

IgorA100 commented 3 weeks ago

Load third-party files first

connortechnology commented 3 weeks ago

We used to do a lot of this if view = stuff in the past. I went instead with just sticking it into the view file itself.. Not sure if it matters in terms of performance but it just seemed cleaner.

IgorA100 commented 3 weeks ago

I did this because:

IgorA100 commented 3 weeks ago

I think it would be more correct if all CSS and JS files are loaded in one place, but not in the “function.php” file, but in a separate one, for example “load_css_js.php”

connortechnology commented 2 weeks ago

css should be first, js should be last, in general these rules only need apply to the bulk of the core UI parts. Third party libraries if only used on view don't matter so much. They tend to all end up being cached anyways.

I would not accept a PR moving loading of CSS/js into another file. They are fine in function.php.

The biggest optimisation we can do right now is to deal with the fonts. These are large and largely unused.

IgorA100 commented 2 weeks ago

The biggest optimisation we can do right now is to deal with the fonts. These are large and largely unused.

I remember about this. I haven't come up with a good idea yet... I'm currently working on changing the Ratio

connortechnology commented 2 weeks ago

https://stackoverflow.com/questions/64614572/creating-a-material-icons-subset

Lots of people do it. I started to get into it one day but ran out of time.