This is the Bocoup web log with posts from Al, Ben, Boaz, Darius, Greg, Irene, John, Mike, Nate, Nick, Pete, Richard, Rick, Sam, Sam Clearman, Scott and Tim. You should also make sure to checkout code.bocoup.com, where we keep the finished versions of ideas we kick around here.



Aug 17, 2010

Webkit Radial Gradients

I started to play around with the inset value of the CSS3 box-shadow property over at boaz.se/nder/s.miscellaneous/i-<3-inset after maxvoltar posted about it.

I started working with the CSS3 gradient property to achieve the effect reproduced here, and I ran into some serious syntax confusion. Whereas Gecko offers a terse verbose syntax for radial gradients, Webkit only offers the verbose syntax. So here is an explanation in plain english of what each value in a Webkit radial gradient does:

  -webkit-gradient(radial, a b, c, d e, f, from(g), to(h));

    a: circle 1 x-axis
    b: circle 1 y-axis
    c: circle 1 radius
    d: circle 2 x-axis
    e: circle 2 y-axis
    f: circle 2 radius
    g: circle 1 color
    h: circle 2 color

I’ve reproduced the contenteditable from boaz.se below in order to play with gradients!:


Gecko’s implementation offers the same flexibility as Webkit, however, Gecko also offers a simplified version for achieving your basic, plain old two color, even gradient: -moz-radial-gradient(#fff, #999)

Oh hey, what the heck is a color stop?!

A color stop is what the color value should be at a given point in the gradient. You can add in more than one. You can add one in like this:

  i: point in gradient at which to stop (number, percent, etc)
  j: color at which to stop (hex, etc)
  -webkit-gradient(radial, a b, c, d e, f, from(g), to(h), color-stop(i, j));



Comments:




Please send your questions to this address or call Bocoup at 617-379-2752.
This web page is proudly maintained by Bocoup and hosted by (mt) Media Temple.
All code on this website is Open Source. Want to work at Bocoup? Then Apply.
HTML5 Powered with Connectivity / Realtime, CSS3 / Styling, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage