PDA

View Full Version : Change color of a icon-font



Tioecomp
6 Nov 2013, 4:17 AM
Hi all, I'm having some trouble to change the color of a custom icon-font, i'm able to change the color of the background but thats not what I want. For example I have a custom icon 'testIcon' if I try to apply this


.testIcon{
background-color: -webkit-linear-gradient(top, #1EFD00, #14FF00 3%, #287A2B) !important;
font-size:2em;
}
on scss it changes the background if I try color: red nothing happens, even if i put !important.

slemmon
11 Nov 2013, 11:16 PM
Color is the rule I've used before.
Here's an example:

1gt

Open the Fiddle up in its own window and click on the menu button bottom-left and then click on app.css to see the stylesheet.
https://fiddle.sencha.com/#fiddle/1gt

Spenna
12 Nov 2013, 2:24 AM
I'm guessing you're targeting the wrong element with your css, font-icons are often inserted with the ':before' pseudo-element. (See your font-css file for this).
If so, try something like this:


.testIcon:before{
color: red;
}