Closed prtksxna closed 10 years ago
We split the icon sets up mostly to reduce the overhead of using icons in the default set. The full set of icons is currently 132KB, but only 40KB for the default set.
We may find a better way to dynamically load icon sets in the future.
So, my current way of importing is correct?
We may find a better way to dynamically load icon sets in the future.
You mean we could probably detect that an iconset is being called and then asynchronously import that component (is that even possible) after the page is done loading?
Icons (images in general) are a high-priority (needed for render) and (relatively) high bandwidth resource. For this reason, we don't serve any by default (you must always import something [usually core-icons
] if you want to use them).
Upshot: yes, what you are doing is correct, and demand-loading is IMO not a really good idea.
After importing
core-icons.html
one only gets access to the icons in icons.html and not the other icon sets. Is it normal to add the import separately like—Or should all the iconsets actually be included in core-icons.html?