This simple and awesome technique uses the Appearance panel and effects to generate editable gradient strokes in Illustrator.
The Problem and its Solution
In the Illustrator you won’t be able to apply a gradient to strokes the way you normally apply to other objects. If you want to create a stroke on an object go to Object > Path > Outline Stroke and then fill the stroke with gradient. But you can’t change the weight of the stroke later. Besides, you cannot use the Outline Stroke method on type by keeping the text still editable. With the following technique explained below, you will be able to add gradient strokes to objects and text while keeping them still editable!
Adding Gradient Strokes to Objects
Let’s go through the steps required for adding gradient stroke to objects.
Select your object using the Selection tool and make sure it has no strokes applied. After selecting the object go to the Appearance panel menu (top left menu button) in the Appearance panel and choose New Fill. In the Appearance panel you will see two fills.
Choose the last fill in the appearance panel and go to go Effect > Path > Offset Path and enter the size of your stroke. You can use pixel points or whichever measurement you usually use for the stroke weight.
Now you will be able to change the offset fill to a gradient and you are done! The main advantage of using this technique is that is you can go to Appearance panel, select the Offset, and change it just like changing the stroke weight!