As of CS5, Adobe Illustrator still does not have the inherent ability to apply gradients to strokes. Hopefully a future version of Illustrator will introduce this functionality. However, there are various ways to finagle the software into imitating this capability (which is a commonly-used feature of Adobe Photoshop). Here is a fairly easy way to simulate gradient strokes in Illustrator.

Download File

gradientstroke.ai (1.1 MB) Download gradientstroke.ai

We’re going to make a simple web button to demonstrate this technique. The intent is not to get bogged down in details: it is to teach the methodology, so feel free to use colors and shapes of your own choosing.

  • Draw an object. I chose a rounded rectangle.
  • Open the Appearance panel and give your object no stroke and a fill of your choosing.
    Draw a shape and give it a fill

    Draw a shape and give it a fill

    I used a linear gradient with the following properties:

    Angle -90°

    Start point: color: C=49, M=15, Y=0, K=0, Opacity: 100%, Location: 0%

    End point: color: C=85, M=50, Y=0, K=0, Opacity: 100%, Location: 100%.

  • Add another fill below the first. This will be the first of our gradient “strokes”.
    Apply a gradient fill and offset the path.

    Apply a gradient fill and offset the path.

    Apply an Illustrator Effect to this fill using PathOffset Path… with an offset value that suits you (I used 1pt). This will simulate a stroke effect by expanding the fill to be larger than the previous one.

    Apply a gradient fill. I used a linear gradient with the following properties:

    Angle -90°

    Start point: color: C=35, M=7, Y=0, K=0, Opacity: 100%, Location: 0%

    End point: color: C=37, M=0, Y=0, K=23, Opacity: 100%, Location: 100%.

  • Repeat this process to add a second stroke. This stroke is the outside border of the button.

    Apply an Illustrator Effect to this fill using PathOffset Path… with an offset value that suits you. This offset must also accommodate the previous one, so add the value of the previous offset to this one (I used 2pt).

    Add another gradient fill, offset path, and add a drop shadow.

    Add another gradient fill, offset path, and add a drop shadow.

    Apply a gradient fill. I used a linear gradient with the following properties:

    Angle -90°

    Start point: color: C=35, M=7, Y=0, K=0, Opacity: 100%, Location: 0%

    End point: color: C=37, M=0, Y=0, K=23, Opacity: 100%, Location: 100%.

    I chose to apply a Drop Shadow effect to this fill via StylizeDrop Shadow… I used Mode: Multiply, Opacity: 50%, X Offset: 0pt, Y Offset: 1pt, Blur: 1pt, Color: C=75, M=68, Y=67, K=90.

Those are the basics. Experiment and play around with this method to achieve more advanced effects.

You can also create “inner” strokes by giving fills a negative offset value. This makes them smaller than the fills that are stacked beneath them and keeps them within the boundaries of the path. You can use any combination of negative and positive offsets.

Although this method utilizes “faux” strokes, it is more flexible than Photoshop’s layer styles in that you can stack more fills as well as apply other types of effects to individual fills. You should find that you can create some very sophisticated graphics using just one path in this way.

That's it!

That's it!