not-matthias / apollo

Modern and minimalistic blog theme.
https://not-matthias.github.io/apollo
MIT License
121 stars 70 forks source link

Exclude feather.js from <head> if theme toggle is not used #27

Closed 190n closed 12 months ago

190n commented 1 year ago

Currently the Feather icon library is always included in the page:

<script src=http://127.0.0.1:1111/js/feather.min.js></script>

This is 71 KiB of JavaScript and it seems to only be used for 2 icons if the theme toggle widget is enabled. Could it be excluded if the theme is set to auto, light, or dark? I can PR this change if desired.

It may also be worth considering inlining those two icons, or using similar-looking Unicode symbols.

not-matthias commented 12 months ago

That would be a good idea. I'll try to implement it, as it doesn't seem like too much work. We can also use the feather svg directly instead of using the Javascript library I think.