Mobile app version of vmapp.org
Login or Join
Samaraweera207

: Sketch Only Apply Shadow To Outside Edge of Element I have an element in sketch that has a lot of intersections in the middle of it - when I try to apply a shadow to this element, the

@Samaraweera207

Posted in: #DropShadow #Mask #SketchApp

I have an element in sketch that has a lot of intersections in the middle of it - when I try to apply a shadow to this element, the shadows become visible in the middle where the intersections are, in addition to the border.

If you look at the image, you can see what I mean - the purchase 'button' is made via an intersection, because I want to preserve the background's gradient. However, I don't want the shadow visible here - just on the edges of the white box.

Is there any way to get this to happen?

I was playing with masking a little bit, but I have several elements like this purchase button - masking them all and re-organizing the layers is a lot of work and I was wondering if there was an easier way.

Thanks!

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Samaraweera207

3 Comments

Sorted by latest first Latest Oldest Best

 

@Sent7350415

If I understand the question correctly, there are two answers that come to mind.


Yes, you can use the same gradient throughout, but you'll have to adjust it on every single element you have. Like so:

Another, more scalable option, is to create a layer underneath the intersected shape. Give it some stroke width and a shadow, and go wild with the intersections. Please have in mind that someone will have to apply front-end logic to this design.




Check out the files as well.Check the Sketch File here.

10% popularity Vote Up Vote Down


 

@Chiappetta793

This is definitely a hack, but try this.
1) Duplicate the background with the gradient, 2) make a button on top with exactly the wanted dimensions - 3) clip those two shapes and 4)remove the hole beneath.
Then you would end up with a moveable button instead of a hole in the white shape.

This would mess up if you modify the gradient at a later point, but for now I hope it helps.

Alternatively, you can make the hole (button) bigger than it should be and manually make a mask that covers the shadows... (see the attachment for reference, just make the red mask the same color as the surroundings)

10% popularity Vote Up Vote Down


 

@Bryan765

The shadow works like it is supposed to. You've cut-out your object, so if you apply a shadow it will be the shadow of a cut-out object.

If I look at your picture you can also add a blue background that blocks the shadow.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme