719332d272
We currently serve icons in the form of 141 separate svg files. This is pretty inefficient: it results in 141 http requests each with its own overheads and costs. Each one is generally less than 1kb of data. This PR merges all of our icons into a single 44kb icon file. Each item in the svg has an ID, and we use the ID in the asset url to target the specific icon. This also fixes a lot of the icon preloading issues: because the icon file is already loaded, there's no extra request needed when panels open etc. I was messing with this whilst killing time before a late meeting so made a shitty overengineered code generator, dont at me ### Change type - [x] `improvement` ### Release notes - Serve icons more efficiently, and make sure they're still available if tldraw goes offline.
4 lines
792 B
XML
4 lines
792 B
XML
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M15.5968 7.18642C15.761 7.31414 16.0002 7.19712 16.0002 6.98908V5C19.9629 5.00003 22.3696 5.72743 23.8211 7.17893C25.2726 8.63046 26 11.0372 26 15C26 15.5523 26.4477 16 27 16C27.5523 16 28 15.5523 28 15C28 10.8876 27.265 7.7944 25.2353 5.76472C23.2056 3.73507 20.1125 3.00003 16.0002 3V1.0114C16.0002 0.803367 15.761 0.686343 15.5968 0.814065L11.754 3.80291C11.6253 3.903 11.6253 4.09749 11.754 4.19758L15.5968 7.18642Z" fill="black"/>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.5 9.00003C2.67157 9.00003 2 9.6716 2 10.5V27.5C2 28.3285 2.67157 29 3.5 29H20.5C21.3284 29 22 28.3285 22 27.5V10.5C22 9.6716 21.3284 9.00003 20.5 9.00003H3.5ZM4 11V27H20V11H4Z" fill="black"/>
|
|
</svg>
|