mixxorz / django-inline-svg Goto Github PK
View Code? Open in Web Editor NEWA simple SVG template tag for Django
License: MIT License
A simple SVG template tag for Django
License: MIT License
Hi.
I need to show the same inline svg with different sizes.
What I normally do is opening the svg file with and adding width="XXX"
to the svg tag. So now I have a svg file duplicated with different sizes and I don't like this solution. What is the easiest way to achieve this?
Right now, you have to put your svgs under svg/
. It would be nice if it was configurable.
https://github.com/codedread/scour
This might be useful as an optional dependency or something; most SVGs in browsers don't need even half the stuff that editors put in there.
Multiple svg don't work because of overlapping classes. Maybe if you can include the svg in an object tag?
Any plans to allow SVG to be created "on the fly" (perhaps in a view) and then passed into the tag?
This project is awesome, but one thing you may want to consider is using <g>
groups in a larger hidden SVG tag and then outputting <svg ...><use xlink:href="#id"></svg>
where the SVG should go. As it stands right now it looks like you're outputting the full SVG each time, which ultimately increases the total size on the request. By using the groups you can just shove each SVG in once and go from there - this works for me in my personal projects, and I've not found any browser issues with it (someone can correct me if I'm wrong).
I'm not sure why but I don't see people do this too often, seems overlooked in terms of a good practice. Maybe a configurable option?
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.