Today I Learned - Rocky Kev

TIL Copy/Paste SVG Icons

POSTED ON:

TAGS:

One of the cool webpack configs that you can set up is to have inline SVG. SVG files themselves are xml, which can be read directly by the browser.

And by inlining the SVG, you make one less call, and it loads faster. But there's a cut-off. Typically, if the SVG is 1kb or smaller, it's better to inline them for the highest optimization.

Font Icons, like FontAwesome, require you get the entire file, just for a few icons.

This site, Hero Icons is dope because it gives you a huge list of icons, and pastes the inline SVG code right into your clipboard.

Check it: https://heroicons.dev/


Related TILs

Tagged:

TIL Gmail has a 102KB size-limit for HTML

PLACEHOLDER

TIL how Error correction works in HTML

You never get an 'Invalid Syntax' error on an HTML page. Browsers fix any invalid content and go on.

TIL what DOCTYPE means

tl;dr: DOCTYPE declaration in the first line of the HTML file, to instruct the browser to run the code in Standard mode.