Box shadow
Use box shadows to add depth inside or outside of element boundaries.
Box shadows are visual effects which displays elements with a shadow. You can access text shadows by selecting a text element and going to Style panel > Effects > Box shadows.
In this lesson, you’ll learn:
How to create box shadow transitions
You can add box shadow transitions so when site visitors interact with the element, the box shadow changes its appearance. For example, you can add a hover effect to an element that will make the box shadow’s color grow darker when someone hovers over the element:
- Select the element you want to add a box shadow transition to
- Go to Style panel > Effects > Box shadows
- Click the “plus” icon to add a box shadow
- Change the color to black and add 20% opacity
- Add a box shadow to an element and style with black color and 20% opacity
- Select Hover from from the States dropdown
- Go to Style panel > Effects > Box shadows
- Set the box shadow to 55% opacity
- Select None from the States dropdown
- Go to Style panel > Effects > Transitions
- Click the “plus” icon to add a transition
- Select Box shadow from the Type dropdown
- Set a Duration or leave it at the default 200ms
After you add the transition, the hover effect is a smooth fade between the None state and the Hover state. Without the 200ms transition, the hover effect would cut abruptly back and forth between the opacity levels.
How to create box shadow borders
You can add multiple box shadows on a single element to create unique visual effects. Here’s an example of how to create a subtle border and shadow using multiple box shadows:
- Select the element you want to add a box shadow transition to
- Go to Style panel > Effects > Box shadows
- Click the “plus” icon to add a box shadow
- Select Outside as the Type
- Change the X and Y values as preferred
- Set Blur to 0px
- Set Size to 1 px
- Set Color to rgba(0,0,0,0.1) - black with 10% opacity
- Set the color of the shadow rgba(0, 0, 0, 0.1) (i.e., black with 10% opacity)
- Go to Style panel > Effects > Box shadows
- Click the “plus” icon to add another box shadow
- Set Blur to 8px
- Change the X and Y values as preferred
- Set Color to rgba(0, 0, 0, 0.1)