I realise Lucky does not use annotations a lot, but I think they are helpful in this case. The settings defined by the annotations are reasonable defaults, I think, but if necessary, users can jump in and override the defaults.
This PR implements #1760.
Checklist
[X] - An issue already exists detailing the issue/or feature request that this PR fixes
[X] - All specs are formatted with crystal tool format spec src
[X] - Inline documentation has been added and/or updated
[X] - Lucky builds on docker with ./script/setup
[X] - All builds and specs pass on docker with ./script/test
Purpose
Adds a macro to inline SVG files at compile time.
Description
SVG logos and icons can be inlined with the
inline_svg
macro in pages and components:This will:
src/svgs
at compile-time (path configurable with an annotation)data-inline-svg
attribute with the path of the icon (e.g.<svg data-inline-svg="buttons/round.svg">
)Icons can then be styled with:
Or:
I realise Lucky does not use annotations a lot, but I think they are helpful in this case. The settings defined by the annotations are reasonable defaults, I think, but if necessary, users can jump in and override the defaults.
This PR implements #1760.
Checklist
crystal tool format spec src
./script/setup
./script/test