Comments (5)
@Soean Thanks for pointing that out.
Sadly: The scope attribute has been removed from the current specification.
What can be done is to give svg a unique id and use that in embedded into svg style tag
So:
<svg viewBox="0 0 66 66" style="shape-rendering:crispEdges" id="svg1"><style>#svg1 .bg{fill:#FFFFFF}#svg1 .fg{fill:#00ff00}</style>
<svg viewBox="0 0 66 66" style="shape-rendering:crispEdges" id="svg2"><style>#svg2 .bg{fill:#FFFFFF}#svg2 .fg{fill:#ff00ff}</style>
Are you willing to add your JS changes / PR or would you like me to think that over?
from qrjs2.
Hey @englishextra, thanks for your answer :-)
Yes, I also found the removed scope attribute. Right now, I have no real solution. I built a wrapper around the svgs for my own project.
from qrjs2.
tested in Chrome / Edge / Firefox and as you know for IE11 there's a fallback to PNG
I'll updated npm and bower very soon.
from qrjs2.
@englishextra
Thanks, works great!
from qrjs2.
Updated at npm
CDN
jsDelivr
https://cdn.jsdelivr.net/gh/englishextra/[email protected]/qrjs2.min.js
unpkg
https://unpkg.com/[email protected]/qrjs2.js
from qrjs2.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qrjs2.