Giter VIP home page Giter VIP logo

Comments (8)

driesvints avatar driesvints commented on August 28, 2024 1

I see. That could indeed be beneficial. I'll re-open this and leave it open for now. I don't think I'll get to this for the 0.4.0 release but maybe later on.

from blade-icons.

extrabright avatar extrabright commented on August 28, 2024

Yep, that would be cool to add.

from blade-icons.

driesvints avatar driesvints commented on August 28, 2024

I'm not sure what the problem is. Do you mean that at the moment when you call svg_image('Foo') twice that the second outputted SVG doesn't has the Foo class? Can you try this with the next version branch? #50

from blade-icons.

driesvints avatar driesvints commented on August 28, 2024

Going to close this one. Feel free to provide feedback when you can.

from blade-icons.

yaquawa avatar yaquawa commented on August 28, 2024

@driesvints
I mean if I have a svg file like this:

<svg class="foobar">...</svg>

svg_image('Foo') will erase the original class attribute and bring me this:

<svg>...</svg>

from blade-icons.

extrabright avatar extrabright commented on August 28, 2024

@yaquawa is right. I have the same issue. I have an already applied class on the svg, but when I want to add new classes when using the injector you’ve build, it erases the original class.

from blade-icons.

davidhsianturi avatar davidhsianturi commented on August 28, 2024

@extrabright if you have already applied class on the SVG, i think you need to set default classes in the config file (in case you have the same value of class for all SVG)
if not, the browser will always override this by passing an explicit class with your attributes.

from blade-icons.

driesvints avatar driesvints commented on August 28, 2024

I'm going to close this one as I don't think it's feasible to ever solve this in a clean way. It would mean the library would need to check every single icon for existing attributes. I think the direction I want to take the package more is to having icons not implement any attributes that aren't needed to "shape" the icon like class, id, etc. and let those be added through the package instead.

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.