scittle

Chris McCormick 2025-05-11T14:03:53.101079Z

â„šī¸ iconloader.cljs is a way to preload SVG icons into your Scittle/Reagent web app. The problem this solves is using SVG icons from e.g. http://tabler.io/icons or fontawesome and having them preload before the app launches so you can inline the SVGs (to take on page colors or whatever). Usage: Add this to your index.html: <script type="application/x-scittle" src=""></script> Then :require or :require-macros these: - (load-icon "some.svg") - macro that loads the SVG icon at compile time. - (wait-for-preload) - macro that returns a promise at runtime which resolves once all icons are loaded. - [icon svg] - hiccup component that creates a [:i.icon ...svg...] with the rendered SVG. - (set-svg-base-url url) - macro to set base URL to load SVG icons from. Demo page here: https://chr15m.github.io/scittle-iconloader/ https://github.com/chr15m/scittle-iconloader

🎉 3