Giter VIP home page Giter VIP logo

Comments (9)

driesvints avatar driesvints commented on August 28, 2024

This is a bit out of scope of this library I'm afraid as we can't control the elements that you place inside your svgs.

from blade-icons.

EvilLooney avatar EvilLooney commented on August 28, 2024

Hmmm ok.

But maybe it should be noted to the documentation that this library cannot handle SVG namespaces as it takes valid markup and renders it gibberish:

// SVG 
<svg:svg width="300px" height="200px">
    <svg:circle cx="150" cy="100" r="50" fill="#ff0000"/>
</svg:svg>

// Blade
{{ @svg('/path/to/file', 'myclass') }}

// Output
<svg class="myclass":svg width="300px" height="200px">
    <svg class="myclass":circle cx="150" cy="100" r="50" fill="#ff0000"/>
</svg:svg>

from blade-icons.

driesvints avatar driesvints commented on August 28, 2024

Why would <svg:svg be valid?

from blade-icons.

EvilLooney avatar EvilLooney commented on August 28, 2024

Well I didn't write the spec but I see it being allowed:
https://www.w3.org/TR/SVG2/struct.html#Namespace
https://developer.mozilla.org/en-US/docs/Web/SVG/Namespaces_Crash_Course

from blade-icons.

driesvints avatar driesvints commented on August 28, 2024

I see. Thanks for making me aware.

Does the parent always use <svg:svg or could it be something else as well like <svg:foo?

from blade-icons.

EvilLooney avatar EvilLooney commented on August 28, 2024

It's actually a prefix and it's reused for each element. I believe if it's different from svg, it needs to be defined with the xmlns attribute:

<foo:svg xmlns:foo="http://www.w3.org/2000/svg" width="300px" height="200px">
    <foo:circle cx="150" cy="100" r="50" fill="#ff0000"/>
</foo:svg>

from blade-icons.

driesvints avatar driesvints commented on August 28, 2024

Well, I wouldn't need this myself but would be open to prs that implement this in a nice and clean way. We're currently undergoing some transition however with #50 so you might wanna hold off until that's done.

from blade-icons.

EvilLooney avatar EvilLooney commented on August 28, 2024

No problem.

I understand that this will never be used 99.99% of the time. I just noticed it when trying to find a workaround with a problem on Vue's end.

from blade-icons.

driesvints avatar driesvints commented on August 28, 2024

I'm going to close this as I don't intend to implement this myself any time soon but happy to look at a PR if anyone wants to send one in 👍

from blade-icons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.