Giter Club home page Giter Club logo

Comments (4)

danklammer avatar danklammer commented on May 22, 2024 1

@saboorazizi You can load the entire SVG library once (even as n external file for cache advantages), and use the tag to show the icons you want. Demo:
https://cdn.rawgit.com/danklammer/bytesize-icons/master/examples/bytesize-symbols.html

<use xlink:href="/icons/bytesize-icons.svg#i-search" />

Note: This doesn't work for IE, so you'd you need to use a polyfill like SVG4Everybody:
https://github.com/jonathantneal/svg4everybody

from bytesize-icons.

Fastidious avatar Fastidious commented on May 22, 2024

OK, I found a way to do it. The trick is to use xmlns="http://www.w3.org/2000/svg”, and I also base64 encode it. That works. Now I have run into another issue, which I believe it can’t be fixed. It seems stroke=“currentcolor” will not work, the icon will be rendered black. Does anyone knows a way so that the icon will inherit the colour?

from bytesize-icons.

danklammer avatar danklammer commented on May 22, 2024

Since you are rendering the SVG as an image you won't be able to manipulate fills or stroke from DOM.

from bytesize-icons.

saboorazizi avatar saboorazizi commented on May 22, 2024

Hi ! I am new to html, css and others, and I am sorry if my question is not appropriate.

I search a lot to fine hoe could I load the SVG icons in to a CSS file and then use it in a project or a php file. I don't want to have the SVG tag inside my php or html tags.

Before I use glyphicon with bootstrap, inside a span tag. Can I load it in a span/id or class and the source should be out side of the file:
<link href="../style/css/bytesize.css" rel="stylesheet">

Thank you!

from bytesize-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.