SVG Icon Macro
For users of icondata, Singlestage includes a macro to make using icons a bit easier. We use this macro internally and although it's not officially part of the library, we're happy to provide it to you. The ids for these icons, as well as a search function, can be found on Carloskiki's Icondata page.
More information regarding the usage of SVG, and its attributes, can be found here.
Basic usage:
... <A href="/icon-macro"> {icon!(icondata::LuImage)} "Icon Macro" </A> ...
Advanced usage:
... <A href="/icon-macro"> {icon!(icondata::LuImage, width=100, class="stroke-1", style="stroke:red")} "Icon Macro" </A> ...
In both cases the first argument is required, and must be an icondata id.
The icon macro will accept, in no particular order, any or none of the following arguments:
| Name | Notes |
|---|---|
| width | Default: 100% |
| height | Default: 100% |
| stroke_linecap | Notice the underscore |
| stroke_linejoin | Notice the underscore |
| stroke_width | Notice the underscore |
| stroke |
|
| fill |
|
| style |
|
| class |
|