2
votes

I want to stylize one of the font icon provided with Font Awesome called fa fa-user and render color in a similar way with the below sample.

enter image description here

Circular border is not a problem but I cannot think of ways to render this kind of glassy looking color combinations without using background-image property.

As far as I'm concerned, color is the only usable property because it's a font.

Is anything near to the sample image achievable with CSS?

This is Demo

EDITED

I should have mentioned that I am not looking to get the glassy look on the background. Only on the icon itself.

2

2 Answers

2
votes

You can certainly get close with some neat CSS3 effects (text-shadow and gradients)

http://jsbin.com/UCokedat/1/edit

.fa-user {
  color: white;
  background-color: lightgrey;
  padding: 40px 45px;
  font-size: 50pt;
  border-radius: 50%;
  text-shadow: 1px 1px 1px silver;
  text-shadow: inset 1px 1px 1px #eee;

 background: rgb(226,226,226);
background: -moz-linear-gradient(-45deg,  rgba(226,226,226,1) 0%, rgba(219,219,219,1) 50%, rgba(209,209,209,1) 51%, rgba(254,254,254,1) 100%);
background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(226,226,226,1)), color-stop(50%,rgba(219,219,219,1)), color-stop(51%,rgba(209,209,209,1)), color-stop(100%,rgba(254,254,254,1)));
background: -webkit-linear-gradient(-45deg,  rgba(226,226,226,1) 0%,rgba(219,219,219,1) 50%,rgba(209,209,209,1) 51%,rgba(254,254,254,1) 100%);
background: -o-linear-gradient(-45deg,  rgba(226,226,226,1) 0%,rgba(219,219,219,1) 50%,rgba(209,209,209,1) 51%,rgba(254,254,254,1) 100%);
background: -ms-linear-gradient(-45deg,  rgba(226,226,226,1) 0%,rgba(219,219,219,1) 50%,rgba(209,209,209,1) 51%,rgba(254,254,254,1) 100%);
background: linear-gradient(135deg,  rgba(226,226,226,1) 0%,rgba(219,219,219,1) 50%,rgba(209,209,209,1) 51%,rgba(254,254,254,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e2e2e2', endColorstr='#fefefe',GradientType=1 );

}
2
votes

Not sure it can be totally duplicated, but I went after a somewhat similar idea as SpliFF

http://jsbin.com/OGIKIQa/6/edit

    .fa-user {
  color: white;
  padding: 40px 45px;
  font-size: 50pt;
}
.fa-user:before {
  background: -moz-linear-gradient(-45deg,  rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(0,0,0,0.65)), color-stop(100%,rgba(0,0,0,0))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(-45deg,  rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(-45deg,  rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(-45deg,  rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 100%); /* IE10+ */
background: linear-gradient(135deg,  rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a6000000', endColorstr='#00000000',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */


  color: white;
  background-color: lightgrey;
  padding: 40px 45px;
  font-size: 50pt;
  border-radius: 50%;
}