1

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. note border inside purchase

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!

3 Answers 3

1

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

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

  2. 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.

enter image description here

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

1
  • Option 2 is what I'd recommend as well 🎉
    – spjpgrd
    Apr 19, 2018 at 22:05
0

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.

1
  • It's not as simple as that, as the background is a gradient and not just a solid fill
    – mjkaufer
    Jul 21, 2017 at 2:04
0

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)enter image description here

Your Answer

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

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