googlearchive / core-icons

core-icons
41 stars 18 forks source link

Separate import for other icons #5

Closed prtksxna closed 10 years ago

prtksxna commented 10 years ago

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—

<link rel="import" href="bower_components/core-icons/iconsets/maps-icons.html">

Or should all the iconsets actually be included in core-icons.html?

dfreedm commented 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.

prtksxna commented 10 years ago

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?

sjmiles commented 10 years ago

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.