vorillaz / devicons

Devicons - An iconic font made for developers
http://vorillaz.github.io/devicons/
2.67k stars 197 forks source link

Fallback icon #112

Open giammaleoni opened 8 years ago

giammaleoni commented 8 years ago

Hello!

I'm using your awesome icon set in my angular2/ionic2 application where I have to list all github languages and your repo fits perfectly, but I want to have a fallback when the app can't find an icon. In this case I want to display the devicons-code icon as a fallback.

My span looks like the following: <span class="no-margin devicons devicons-{{item.icon}} devicons-code"></span>

Where {{item.icon}} is substituted during compile by the name of an icon:

Code:

<div><span class="no-margin devicons devicons-closure devicons-code"></span><div>
<div><span class="no-margin devicons devicons-cmake devicons-code"></span><div>
<div><span class="no-margin devicons devicons-cobol devicons-code"></span><div>
<div><span class="no-margin devicons devicons-coffeescript devicons-code"></span><div>

So both class are present, but every time I get the devicons-code icon. I needed to change the CSS file in order to put the .devicons-code class as first (before .devicons-git) in order to be overwritten if another existing language exists:

image

I think that could resolve a problem for a lot of people using angular. Bye!! Gianmaria