box-shadow Property

Are there plans to add support for box-shadow property in uss? What’s a good way to add a drop shadow to a button using what’s currently available?

It is planned!

Right now, however, your best bet would probably to create a 9-sliced texture and assign it as the background an element that will act as the shadow.

To make slices, you can either use the USS styles (-unity-slice-left, etc.). Or simply use a sprite with borders (Unity - Manual: 9-slicing Sprites).

2 Likes

Thanks for the reply @mcoted3d !

It’s been a year. I am just switching my project over to the Unity UI Toolkit.

I was using the True Shadow addon:
https://assetstore.unity.com/packages/tools/gui/true-shadow-ui-soft-shadow-and-glow-beta-176322

On my regular UI, but now that I am moving to UI Toolkit it seems I am stuck. Is this something someone could develop a similar third party solution script for or do you have an ETA on completion of your shadow option?

This is honestly quite critical and it’s hard to work without it.

1 Like

same

Hello, I refer you all to this Soft Shadow component that I made for UI Toolkit :slight_smile:

2 Likes