css - create multicolor icons. Icomoon -


it's been hard find clear information how create icons 2 colors (facebook -white , blue-, google- white , red.....). customer wants able change 2 colors pleases. have been looking around , i've found http://www.programask.com/question_41701651_multicolored-icon-fonts# seems quiet easy , clear client purpose (change color when want, haven't understood procedure...).

i use icomoon, can't find how add colors....

so understood need image editor, in case of facebook icon, select "f" , save in .svg , same background "without f", , save svg too, then.... how put them refer 1 icon?

i don't need icomoon though (but need free software), can explain me how color icons through css?

thank you

creating multicolored icon fonts icomoon easy combines them multiple glyphs off course , seems have no knowledge of "default" color (the color can changed parent class) - need define inherit in css :

1) create svgs favorite vector app inkscape or adobe illustrator.

important : icomoon (and else) use 1 glyph each colored path in svg, make sure join pathes same color , don't use many colors …

illustrator makes easy join compound pathes : https://www.youtube.com/watch?v=jbc3q9bfoh8 , join objects: https://graphicdesign.stackexchange.com/questions/999/how-do-i-combine-two-objects-into-one-in-illustrator

2) make icomoon font.

3) determine "default" color in css - lets rgb(62, 55, 60);:

in [class^="icon-"], [class*=" icon-"] { add

/* default color */ color: rgb(62, 55, 60); 

and remove every other line reading

color: rgb(62, 55, 60); 

or explicit change to

color: inherit; 

that's it.

when use 2 colors (e.g. darkgrey , orange) joined never more 2 children in icon , change darkgrey root node <span class="icon-myiconname"> ...

here working codepen 2-color font used 1 element can change color …


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -