christianwgd / django-bootstrap-icons Goto Github PK
View Code? Open in Web Editor NEWA quick way to add Bootstrap Icons with Django template tags.
License: MIT License
A quick way to add Bootstrap Icons with Django template tags.
License: MIT License
In the bootstrap_icons.py file, it uses os.path.join
in both bs_icon
and md_icon
, but it's building a URL where we should always have forward slashes, never backwards slashes as you'll end up with if you're running the code on Windows.
As I loaded more icons in my template file on my django project, the site slowed down considerable. Even when I included just 5 icons there was a noticeable difference in site load times. I'm not sure why this is currently but it's a huge downside to using icons in django templates this way.
Tried to use this module with the latest version, 0.8.7, followed the instruction on the pypy page(https://pypi.org/project/django-bootstrap-icons/):
Recived this error:
Invalid block tag on line 9: 'bs_icon', expected 'endblock'. Did you forget to register or load this tag?
At some point Bootstrap Icons seems to have changed the default vertical alignment of the icons. I'll have to take a closer look.
A reliable workaround is to set an explicit alignment with the extra_classes argument or override the global default in CSS.
I noticed performance issues, if i have a long list of objects in a template, that use the same icon. Each icon is completely new rendered.
To avoid this, build some sort of cache, so that icons are only rendered once and simply loaded for each subsequent use.
A width of "1.5rem" seems to work in most browsers but creates errors in the console. Change to "em".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.