Container shadows break when multiple

Being able to assign shadows on stacks/containers is great, however it seems to break as soon as you add a 2nd shadow. See screenshot below with file that reproduces the issue.


Group shadows.sketch (18.3 KB)

Thank you for reporting, Sam!

I’ve been able to reproduce it with our latest version, and I’m making sure to file this one.

I will let you know!

This is unfortunately a technical limitation we’ve had for a long time. You can only have one shadow on fill-less frames (which cast the shadow on their contents, not themselves). This is similar to how groups can’t have two shadows.

As a workaround, I’d suggest applying the shadow to of the frame’s children.

1 Like

Right. However with stacks this means the z-index of the shadows is defined by the order of the stack elements (this wasn’t the case before stacks) so I end up with elements that have their shadows overlap the next element like this:

versus if I put the shadow on the group itself:

Issue with this approach though is that each shadow in our design system is represented by 3 individual shadow that just can’t be replicated with a single shadow.

Now that I’ve exposed my use case maybe you have other workarounds to suggest? Maybe a way to control the z-index of elements inside a stack?

Unfortunately no workaround for this case, I’m afraid. We’d like to clear this technical limitation but I’m not sure if/when that’ll happen. Consider your report a +1 on that request.

1 Like