Search code examples
sketchapp

Sketch: Resize symbol with shadow


Sketch v42.

I have simple box symbol with shadow(x:10, y:10). Alt text

when I resize symbol, shadow is not resized.

Alt text

How I can implement resize(include shadows) on the symbol.


Solution

  • The shadow defined in your symbol will always be "10px 10px 10px 0" that's it won't resize.

    One solution is to create another rectangle, that will remplace your shadow propertie.

    1. Create a clone rectangle (Ctrl + c / Ctrl + v)
    2. Add 10 to the X and Y position of the clone
    3. Change the background color, add a gradient black / transparent in order to make it look like a shadow

    🎉 When you will resize your symbol, this false shadow will resize too.