django-inline-svg
django-inline-svg copied to clipboard
Adds support for passing html attributes to svg templatetag
With inlining SVG's it's often useful to give them class names to support things like using CSS to change fill color. Another really useful approach is when using a framework like tailwind, that uses utility classes to be able to just say:
{% svg 'icon-search' class='h-10 mt-6' %}
and this will add fixed height and top margin to SVG.
This PR adds the ability to add extra attributes to the templatag.
This change is inspired by Log1x/sage-svg, that makes it really easy to use this pattern in Laravel Blade nad Sage Wordpress theme.
wow I want something like that. Why this is not merged yet ?
I checked the PRs hoping to see one that did exactly this. Thanks for putting it together. I'm now using your fork.