I try to keep
extra.less
more or less empty and instead modify existing less templates (like
node_list.less
for node icons, etc.)
Why would I do that if keeping everything in
extra.less
(or sub-templates that are included in
extra.less
) is a lot easier?
Efficiency!
extra.less is included in
every page, so the browser has download the whole CSS in there even if a huge amount isn't used for the current page.
But the download size is only a (rather small) part of
extra.less
inefficiency.
Way more important is that the browser also has to parse all the CSS - and this can significantly affect client performance / CPU / power consumption / battery runtime.
Lighthouse doesn't complain about unused CSS just for fun