django-inline-svg icon indicating copy to clipboard operation
django-inline-svg copied to clipboard

Adds support for passing html attributes to svg templatetag

Open jurecuhalev opened this issue 5 years ago • 3 comments

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.

jurecuhalev avatar Feb 08 '20 16:02 jurecuhalev

wow I want something like that. Why this is not merged yet ?

igorms-pro avatar Nov 24 '22 16:11 igorms-pro

I checked the PRs hoping to see one that did exactly this. Thanks for putting it together. I'm now using your fork.

geoffbeier avatar Jul 19 '23 15:07 geoffbeier