I know how to put a gradient across multiple shapes in Illustrator using compound path - however, in this specific case I have layers with other parts that need to show in front of each other - and using compound path unites those layers in front or behind (as one layer).

To show what I mean see image. I've drawn 3 cubes. I want one face to have one gradient. A single gradient on each is shown top right. Bottom left is what I want to achieve (that gradient stretched across all three) but crucially I need the blocks and layers still in order shown in the top right or top left set.

Important: I cannot CUT into/out these shapes because they will be part of an animation that shows the 3-sides of the cube, appearing one by one, moving into place.

My guess (but I don't know how to...) is make the compound layer as I have, then some keep that gradient as I release the compound layer, then reorder those layers back to where they were. Hopefully someone will know.

enter image description here

3 Answers 3


Essentially, this is the same answer as here only this is more specific to your particular artwork example.

Merely select the individual faces using the Shift key and the Direct Selection Tool (White Arrow).

After the faces are selected, use the Gradient Tool to click-drag across all three faces to apply the gradient across all three faces rather than the faces individually.

There is no need to create a compound shape.

In the animation below, each cube is its own group.

enter image description here

While this animation was created using AICS6, it's the same procedure for newer versions of the app.

This works regardless of whether the cubes are on different layers or the same layer....

enter image description here

If however, you are seeking to keep the gradient position static, while moving the cubes, that may be another matter. I'm not really sure if that's what you are asking. If you can clarify a bit I can try and see if there's a method of achieving movable cubes with a static common gradient. Off-hand, I'd say you'd need clipping masks, but how one would accomplish that may take some doing.

  • Simple as that! Once you know, you know. Thanks @Scott that's ideal.
    – tobzzz
    Commented Jul 15, 2019 at 9:09

Not at all sure about understanding your goal.

But you can make movable holes with knockout group. A simple example:

enter image description here

We have four shapes. In the bottom there's a gradient rectangle (=1). Above it we have three grouped rectangles:

2 = opaque white, 3 = opaque grey, 4= fully transparent grey

In the appearance panel the group has got opacity definition "Knockout Group=V" That knocks invisible everything else but the topmost part of overlapping objects. Because the topmost object is fully transparent, there's a hole. The background gradient can be seen through. More transparent shapes make more holes.

The parts of the group can be selected and moved individually with the direct selection tool or with the normal selection tool in the layers panel. To move the hole select the transparent top object and move it.


If you wanted individual gradients but with central management, I'd have said symbols, but I think given what you've looking for, that's not the right approach. I'm not sure if this would work but if yes - is there a way to apply the technique listed in this question [How to hide what's behind an object in a non destructive way / give it an "invisibility cloak" to your condition?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.