Introducing the heroicons Python Package2021-04-16
heroicons is a free SVG icon set for your websites, from the creators of tailwindcss. SVG icons are great - they’re small, they sit inline in your HTML, and you can scaled and colour them with plain HTML and CSS. And heroicons is a great icon set - minimal, clear, and consistent.
I’ve decided to use both tailwindcss and heroicons in DB Buddy. Since others have shown interest I’ve turned my work into a package.
heroicons itself provides the icon set on their web page for copy-pasting, but this gets tiresome. Inline SVG’s have no labels, and bloat template files. heroicons provides React and Vue packages to summon icons by name, and a zip file for the rest of us.
My new python package
heroicons bundles a shrunken version of that zip file, to provide both Django and Jinja template tags.
Using these you can include an icon by name, set its size, and add extra HTML attributes.
For example, in a Django template:
It currently bundles version 1.0.1 of the icon set, and I’ll update it as new releases come out. Check it out on PyPI.
Thanks to Steve Schoger for creating such great icons!
Want better tests? Check out my book Speed Up Your Django Tests which teaches you to write faster, more accurate tests.
One summary email a week, no spam, I pinky promise.
- Introducing django-linear-migrations
- Improve your Django experience with IPython
- New Testing Features in Django 3.2
Tags: django, python
© 2021 All rights reserved.