Color SVG Sprites - css

I've been using icon-fonts created at IcoMoon and they are fantastic. For this I import an SVG Illistrator output (or use premade icons) and create font files that are attached using CSS #Font-Face. These are only ever one color.
I've been reading about SVG Sprites like here: http://css-tricks.com/svg-sprites-use-better-icon-fonts/
I've tried uploading illistrator SVG files with different colors into IcoMoon (as explained at the bottom of the link above) and then creating a SVG Sprite but the color never comes through (always just one color).
Am I doing something wrong with IcoMoon? How can I create a color SVG Sprite using a site like IcoMoon that can be used to display icons where required?
thankyou
Note: i need multiple colors in each image. (not just one color styled via CSS).

Related

Gtk3: Show animated GIF from CSS

I want to use animated GIF in my Gtk3 application. I know this can be done by assigning GdkPixbufAnimation to the Gtk.Image component, but this approach requires the animation file name to be referenced directly from the source code.
Is it possible to specify the animation file in CSS, like "normal" background image? I tried to set the animated GIF as background-image property of Gtk.Image and Gtk.Label components, but the image is displayed statically.

How can I use a font icon as a background image?

1) I know I can use a font icon using , pseudo selectors (before, after) and "content", but it is not a scalable solution, because I need to make many changes to padding, left, top etc in different situations
2) Using Data URI an svg is ok, but I need to change the fill/color of the svg
based on different actions. I tried the fill property but it is not really working.
I can change/edit the color external but I have a lot of variations and again doesn't scale
The icon fonts(ex: FontAwesome) come with SVG files for the browsers. It is possible to use somehow that file in css (like image sprites) ?
If you want to modify properties of SVG's it will have to be placed inline. So using an SVG as a background and modifying properties won't work.
Libraries like FontAwesome give you a font, not svg's which you can't set as a background either.
I don't see the problem of using the psuedo-selectors :before and :after for this. They are very scalable in my opinion.
If you really want to do it differently you should share some of your code with us so we can get a better understanding of what you're trying to do.

CSS3 Custom generated fonts are sometimes not showing the proper icons

Created a font-icons with material svg and custom svg files using gulp-iconfont-css. Sometimes these font-icons are not appearing with the correct icon they are actually jumbled and on refresh, all icons are arranged properly on the site.
why is it happening like this and how to solve this?

CSS Image Overlay

I am creating a template for my company that will be used down the road on a variety of different clients sites, and they will all range in color. I have created icons for this template that are currently black (or white) and I want to be able to control the color of these icons via css. They are one simple color and in photoshop if you do a blending option of color overlay and choose 1 color, they look great. Is this possible to do in css so when someone is editing this template for future clients that they can control the icon colors in css instead of having to edit every icon in photoshop every time?
It's possible to change the color of a logo in CSS, but not to solve the problem you are talking about. To make a changeable logo you would make a PNG with transparency where the logo is and background color (of the webpage) in the negative space. Then put it over a P or div that has the logo color you want as its background color.
Trouble is, you have just exchanged having a flexible logo color for an inflexible "background" color.
Better to just include both colors of logo, white and black, as part of a "package" that is put up with all websites. Just call the one you want in CSS where you want it.
If your icon is a shape you can make in css, it could work, but I have never heard of anybody doing what you are talking about before.
Its not possible to change the color of icon using css. You can shape it,you can give transparency,opacity etc
Not possible via CSS. You can use some dynamic technologies like Canvas, but it's not good way. I would rather create tool to create icon sets in desired color. You can do it with PHP (phpGD or ImageMagick here is example of similiar problem).
You can do this with images (as long as the background colour is consistent) but it requires thinking outside the box a bit. Open the icon's image file in Photoshop (or similar). Edit it so that the "icon" part (i.e. the bit that is currently black) is transparent, and the background (i.e. the bit that isn't what the icon depicts) is filled white (or whatever the background colour of the site is). Essentially you've "reversed the polarity" of the image. Put the image in the web page, then use CSS to specify it's background-color. Your icon should appear in that colour. Edit: Something like this: http://coding.smashingmagazine.com/2010/10/31/transparent-css-sprites/
A [potentially] much simpler approach would be to use an icon font like http://pictos.cc/. That's just text really, so you can colour it with CSS as usual.
You can do this with CSS pseudo elements and translucent overlays. You can follow the instructions here: http://www.impressivewebs.com/image-tint-blend-css/
If you have a vector logo, you can do this with SVG logos even easier (by altering your SVG colors).
If you make the icon images into a font, then you have full control over both size and color via CSS. Check out the very popular Font-Awesome font, designed to compliment Twitter Bootstrap.
I'm no font expert, but if this approach sounds like a fit, you'll do something like:
create vector graphics from your icons
load them into a font editor, like FontLab Studio
add the new font to your favorite web application. If you need a guide for this, FontSquirrel.com generates great #font-face markup to include their library of free fonts.
It can be done and works well with Firefox and Chrome as far as I know. Example below.
http://demosthenes.info/blog/532/Convert-Images-To-Black-And-White-With-CSS
img {
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
}
I would say the best/easiest answer is to use SVG. The logo should probably be in a vector format to start with so that it can be scaled without detail loss from business cards to billboards.
SVG 'images' are based on shapes. Give the shape you want to change a name, and then address it in CSS to change it's colour.
This article:
http://css-tricks.com/using-svg/
and this example:
http://codepen.io/chriscoyier/pen/evcBu
Do an excellent job of explaining how to achieve this and also show off other possibilities.
SVG at least the basics are now widely supported, ie8 is the only browser holding it back and even so there are ways around this via rendering SVG as an image on the fly.

what specification for jsTree node icons?

I want to create my own node icons for jsTree application. A jsTree sample could be found here
I want to know what specification the new icon has to have
size
transparent?
could you recommend any program (mac or pc)
anything else I forgot
Bit of a weird question, but anyway:
The icons are individually 16x16.
All the icons are inside one .png using alpha transparency (the background).
The CSS Sprites technique is being utilized:
http://static.jstree.com/v.1.0pre/themes/default/d.png
Which image editor to use?
I'd use Photoshop, but any image editor that can handle .png's alpha transparency will work.
Try: https://superuser.com/questions/25451/looking-for-a-good-free-image-editor

Resources