Essentially you don't. Gradient fills are based on the boundaries of the shape they are applied to. If you alter the boundaries, then the gradient position and length will change. It is simply how gradient fills work.
It's a very simple matter to grab the Gradient Tool and move the annotator to where you want it.
Answer from Scott on Stack ExchangeEssentially you don't. Gradient fills are based on the boundaries of the shape they are applied to. If you alter the boundaries, then the gradient position and length will change. It is simply how gradient fills work.
It's a very simple matter to grab the Gradient Tool and move the annotator to where you want it.
You could do this by using a second path and a clipping mask:
Original shape

Original shape with the second shape

Right click to the document with both shapes selected

The result:

Does anyone know how to get the gradient on the top?
How to edit gradient stroke?
Need help changing gradient direction in live paint, if possible.
How to: make a simple mesh gradient in Adobe Illustrator with the Mesh Tool!
Videos
I have a vector graphic on the bottom. It was drawn in illustrator and exported as an svg which I then imported into figma.
However I've been trying to get it to look like the gradient on the top and unable to do it. I've played with multiple linear and radial gradients but it's just not coming very smoothly.
Does anyone know how I could achieve this effect? For context the one on the top is the same graphic with the noir filter on iphone images.
How can I edit an existing gradient stroke? I select stroke color, then Gradient Options, but as soon as I try to edit the gradient it applies that gradient to the fill, which I do not want.
Thanks for any advice.
TL:DR: the title says it all.
I feel like I'm a pretty proficient Illustrator user after the past 3 years of using it, but I still for the life of me can't figure out how to change the gradient direction in live paint. My method to correct this right now is to create a layer with shapes behind the piece that I fill with the gradient direction I need. Is there a better way to go about this? Would would tremendously help my workload, I feel, and maybe I'm taking some unnecessary steps that are wasting time. Any advice is welcome y'all.